Removing Sigterm. Cache write block interval configuration.

This commit is contained in:
softsimon committed 2023-03-20 15:46:05 +09:00
1 parent d54bcc898b
commit 517cf613c1
14 files changed
+26 -15

No files matched your search

+1 -1
View File
@@ -651,7 +651,7 @@ class Blocks {
if (this.newBlockCallbacks.length) {
this.newBlockCallbacks.forEach((cb) => cb(blockExtended, txIds, transactions));
}
if (!memPool.hasPriority() && (block.height % 6 === 0)) {
if (!memPool.hasPriority() && (block.height % config.MEMPOOL.DISK_CACHE_BLOCK_INTERVAL === 0)) {
diskCache.$saveCacheToDisk();
}
+2 -6
View File
@@ -19,16 +19,12 @@ class DiskCache {
private isWritingCache = false;
constructor() {
if (!cluster.isMaster) {
if (!cluster.isPrimary) {
return;
}
process.on('SIGINT', (e) => {
this.$saveCacheToDisk(true);
process.exit(2);
});
process.on('SIGTERM', (e) => {
this.$saveCacheToDisk(true);
process.exit(2);
process.exit(0);
});
}