Skip to content

Commit

Permalink
fix: only ignore active vertices when rescheduling inside the handler
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
tegefaulkes authored and amydevs committed May 23, 2024
1 parent 0c8ea88 commit b442e54
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/discovery/Discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class Discovery {
undefined,
undefined,
gestaltsUtils.decodeGestaltId(parent ?? undefined),
true,
);
return;
}
Expand Down Expand Up @@ -503,9 +504,9 @@ class Discovery {
);
return;
}
const linkedVertexNodeId = node1Id.equals(nodeId) ? node2Id : node1Id;
const linkedNodeId = node1Id.equals(nodeId) ? node2Id : node1Id;
const linkedVertexNodeInfo: GestaltNodeInfo = {
nodeId: linkedVertexNodeId,
nodeId: linkedNodeId,
};
await this.gestaltGraph.linkNodeAndNode(
{
Expand All @@ -521,7 +522,7 @@ class Discovery {
if (claimId == null) never();
await this.gestaltGraph.setClaimIdNewest(nodeId, claimId);
// Add this vertex to the queue if it hasn't already been visited
const linkedGestaltId: GestaltId = ['node', linkedVertexNodeId];
const linkedGestaltId: GestaltId = ['node', linkedNodeId];
if (
!(await this.processedTimeGreaterThan(
linkedGestaltId,
Expand Down Expand Up @@ -745,6 +746,7 @@ class Discovery {
delay?: number,
lastProcessedCutoffTime?: number,
parent?: GestaltId,
ignoreActive: boolean = false,
tran?: DBTransaction,
) {
if (tran == null) {
Expand All @@ -754,6 +756,7 @@ class Discovery {
delay,
lastProcessedCutoffTime,
parent,
ignoreActive,
tran,
),
);
Expand All @@ -776,7 +779,7 @@ class Discovery {
tran,
)) {
// Ignore active tasks
if (task.status === 'active') continue;
if (ignoreActive && task.status === 'active') continue;
if (taskExisting == null) {
taskExisting = task;
continue;
Expand Down

0 comments on commit b442e54

Please sign in to comment.