@aresrpg/sui-checkpoint-reader
Advanced tools
Comparing version 4.1.14 to 4.1.15
{ | ||
"name": "@aresrpg/sui-checkpoint-reader", | ||
"version": "4.1.14", | ||
"version": "4.1.15", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -398,3 +398,8 @@ import { setInterval, setTimeout } from 'timers/promises' | ||
log.info( | ||
{ concurrent_downloads, elapsed: +elapsed }, | ||
{ | ||
concurrent_downloads, | ||
elapsed: +elapsed, | ||
from: sync_settings.current_checkpoint - concurrent_downloads, | ||
to: sync_settings.current_checkpoint, | ||
}, | ||
'[remote] downloaded', | ||
@@ -432,3 +437,6 @@ ) | ||
log.debug({ files: files.length }, '[x] cleaning up checkpoint') | ||
log.debug( | ||
{ files: files.length, from: files[0], to: files.at(-1) }, | ||
'[x] cleaning up checkpoint', | ||
) | ||
@@ -450,2 +458,3 @@ for (const file of files) { | ||
let index = 0 | ||
let index_missing = 0 | ||
@@ -464,3 +473,7 @@ async function get_valid_checkpoint_buffer() { | ||
log.warn( | ||
{ encoding, expected_encoding: BLOB_ENCODING_BCS }, | ||
{ | ||
encoding, | ||
current_checkpoint_number, | ||
expected_encoding: BLOB_ENCODING_BCS, | ||
}, | ||
'Invalid encoding detected, is the checkpoint file corrupted?', | ||
@@ -493,2 +506,3 @@ ) | ||
if (checkpoint_buffer) { | ||
index_missing = 0 // reset as we only want to detect if its stuck | ||
if (++index % 4 === 0) | ||
@@ -505,2 +519,7 @@ log.info({ current_checkpoint_number }, '[>] processing checkpoint') | ||
// checkpoint not found, we wait a bit | ||
if (++index_missing % 10 === 0) | ||
log.debug( | ||
{ current_checkpoint_number }, | ||
'[~] waiting for checkpoint', | ||
) | ||
await setTimeout(100) | ||
@@ -507,0 +526,0 @@ } |
733682
19508