Skip to content

Commit

Permalink
dont use mutex on handleHolochainSignal to avoid starving other execu…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
jdeepee committed Sep 13, 2023
1 parent 35cb295 commit 889df30
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions bootstrap-languages/p-diff-sync/linksAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,19 +256,11 @@ export class LinkAdapter implements LinkSyncAdapter {
// `)
try {
//console.log("PerspectiveDiffSync.handleHolochainSignal: Getting lock");
const success = await this.generalMutex.lock();

if (!success) {
console.log("Failed to get lock due to timeout");
return;
}

//console.log("PerspectiveDiffSync.handleHolochainSignal: Got lock");
this.peers.set(broadcast_author, { currentRevision: reference_hash, lastSeen: new Date() });
} catch (e) {
console.error("PerspectiveDiffSync.handleHolochainSignal: got error", e);
} finally {
this.generalMutex.unlock();
}
} else {
//console.log("PerspectiveDiffSync.handleHolochainSignal: received a signals from ourselves in fast_forward_signal or in a pull: ", signal.payload);
Expand Down

0 comments on commit 889df30

Please sign in to comment.