Skip to content

Commit b25703b

Browse files
committed
make sure to delete the cached FIB only after the delete_by_query completes if present
1 parent d826a06 commit b25703b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/indexer/modules/lifecycleManager.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ export class HyperionLifecycleManager {
4646

4747
const indexPartitionSize = this.conf.settings.index_partition_size;
4848

49-
// Must be a multiple of index partition size, round up if necessary
49+
// Must be a multiple of index_partition_size, round up if necessary
5050
if (this.maxRetainedBlocks % indexPartitionSize !== 0) {
51-
hLog(`max_retained_blocks (${this.maxRetainedBlocks}) is not a multiple of index partition size (${indexPartitionSize}).`);
52-
hLog(`Adjusting max_retained_blocks to be a multiple of index partition size.`);
51+
hLog(`max_retained_blocks (${this.maxRetainedBlocks}) is not a multiple of index_partition_size (${indexPartitionSize}).`);
52+
hLog(`Adjusting max_retained_blocks to be a multiple of index_partition_size.`);
5353
this.maxRetainedBlocks += (indexPartitionSize - (this.maxRetainedBlocks % indexPartitionSize));
5454
}
5555
}
@@ -160,7 +160,6 @@ export class HyperionLifecycleManager {
160160
}
161161

162162
hLog(`Auto pruning completed.`);
163-
await this.master.ioRedisClient.del(`${this.manager.chain}::fib`);
164163
}
165164

166165
private attributesToObject(attributes: NodeAttributeRequirement[]): { [key: string]: string } {
@@ -375,6 +374,8 @@ export class HyperionLifecycleManager {
375374
hLog(`Task ID: ${deleteResponse.task}`);
376375
if (deleteResponse.task && typeof deleteResponse.task === 'string') {
377376
await this.startMonitoringDeleteTask(deleteResponse.task);
377+
} else {
378+
await this.master.ioRedisClient.del(`${this.manager.chain}::fib`);
378379
}
379380
} else {
380381
hLog(`No blocks found to prune in index ${blockIndices[0].index}.`);
@@ -388,8 +389,10 @@ export class HyperionLifecycleManager {
388389
}
389390

390391
async startMonitoringDeleteTask(task: string) {
392+
391393
if (!task) {
392394
hLog(`No task ID provided for monitoring.`);
395+
await this.master.ioRedisClient.del(`${this.manager.chain}::fib`);
393396
return;
394397
}
395398

@@ -401,6 +404,7 @@ export class HyperionLifecycleManager {
401404
});
402405
if (taskInfo.completed) {
403406
hLog(`Delete task ${task} completed.`);
407+
await this.master.ioRedisClient.del(`${this.manager.chain}::fib`);
404408
} else {
405409
hLog(`Delete task ${task} is still running...`);
406410
setTimeout(checkTaskStatus, 5000);

src/indexer/modules/master.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,6 @@ export class HyperionMaster {
329329
});
330330
this.queueMonitor.monitorIndexingQueues();
331331
this.startContractMonitoring();
332-
} else {
333-
hLog('received ship abi for distribution AGAIN!!');
334332
}
335333
},
336334
router_ready: () => {

0 commit comments

Comments
 (0)