Skip to content

Commit

Permalink
adds some more logging, since around midnight utc we still get number…
Browse files Browse the repository at this point in the history
…OfCandlesToSync: 0
  • Loading branch information
ivoputzer committed Sep 17, 2024
1 parent f4189ec commit f819a29
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/sync-coinbase.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ for (const file of await readCache(byExchange('coinbase'))) {
console.log('↳ coinbaseInterval:', coinbaseIntervalFor(file))
const nextUncachedCandleDate = new Date(lastCachedCandleDate.getTime() + INTERVALS.get(intervalFor(file)))
const lastCachableCandleDate = new Date(utcDate(new Date()).getTime() - INTERVALS.get(intervalFor(file)))
console.log('↳ nextUncachedCandleDate:', nextUncachedCandleDate)
console.log('↳ lastCachableCandleDate:', lastCachableCandleDate)
const numberOfCandlesToSync = daysBetween(nextUncachedCandleDate, lastCachableCandleDate)
console.log('↳ numberOfCandlesToSync:', numberOfCandlesToSync)
if (numberOfCandlesToSync === 0) continue
Expand Down

0 comments on commit f819a29

Please sign in to comment.