From a79e51eee812b7f9fc0c5c5be3012e8a2b970d2c Mon Sep 17 00:00:00 2001 From: Noah Prince <83885631+ChewingGlass@users.noreply.github.com> Date: Thu, 21 Dec 2023 09:46:12 -0600 Subject: [PATCH] Fix end epoch start time (#515) --- packages/crons/src/end-epoch.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/crons/src/end-epoch.ts b/packages/crons/src/end-epoch.ts index e52d2c535..d092b7125 100644 --- a/packages/crons/src/end-epoch.ts +++ b/packages/crons/src/end-epoch.ts @@ -64,7 +64,8 @@ const MAX_CLAIM_AMOUNT = new BN("207020547945205"); let targetTs = subDaos.reduce( (acc, subDao) => BN.min(acc, subDao.account.vehntLastCalculatedTs), - new BN(unixNow) + // Start one day back to ensure we at least close the epoch that the job is running in. + new BN(unixNow - 24 * 60 * 60) ); mainLoop: while (targetTs.toNumber() < unixNow) {