Skip to content

Commit

Permalink
Fix wire cleanup, when force should go thru the whole process anyways !
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkingsugar committed Nov 8, 2024
1 parent a4eda49 commit 5253072
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions shards/core/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ inline SHVar *findVariable(SHContext *ctx, std::string_view name) {
}

SHVar *referenceVariable(SHContext *ctx, std::string_view name) {
SHVar* var = findVariable(ctx, name);
if (var)
SHVar *var = findVariable(ctx, name);
if (var)
return var;

// worst case create in current top wire!
Expand Down Expand Up @@ -1473,9 +1473,7 @@ bool isDebuggerPresent() { return false; }

// pub extern "C" fn setup_panic_hook()
extern "C" void setup_panic_hook();
extern "C" void shards_flush_logs () {
spdlog::default_logger()->flush();
}
extern "C" void shards_flush_logs() { spdlog::default_logger()->flush(); }

void installSignalHandlers() {
if (!isDebuggerPresent()) {
Expand Down Expand Up @@ -2414,7 +2412,7 @@ void SHWire::warmup(SHContext *context) {
}

void SHWire::cleanup(bool force) {
if (warmedUp && (force || wireUsers.size() == 0)) {
if (force || (warmedUp && wireUsers.size() == 0)) {
SHLOG_TRACE("Running cleanup on wire: {} users count: {}", name, wireUsers.size());

mesh.lock()->dispatcher.trigger(SHWire::OnCleanupEvent{this});
Expand Down

0 comments on commit 5253072

Please sign in to comment.