tip-kudos-recipients: Make sure we save the latest `lastPayoutProcessingTimestamp` value

This commit is contained in:
Pedro Pombeiro 2018-04-26 19:55:32 +02:00
parent 2c1d67e829
commit fdc3677bf3
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
1 changed files with 2 additions and 0 deletions

View File

@ -177,6 +177,7 @@ async function processPendingPayments (robot, data, saveStateAsyncFunc) {
if (!data.lastPayoutProcessingTimestamp) { if (!data.lastPayoutProcessingTimestamp) {
data.lastPayoutProcessingTimestamp = (new Date()).getTime() / 1000 data.lastPayoutProcessingTimestamp = (new Date()).getTime() / 1000
await saveStateAsyncFunc(data)
} }
const now = (new Date()).getTime() / 1000 const now = (new Date()).getTime() / 1000
@ -238,6 +239,7 @@ async function processPendingPayments (robot, data, saveStateAsyncFunc) {
} }
data.lastPayoutProcessingTimestamp = (new Date()).getTime() / 1000 data.lastPayoutProcessingTimestamp = (new Date()).getTime() / 1000
await saveStateAsyncFunc(data)
robot.log.debug(`Total payments: ${totalPayments} ${tokenID}`) robot.log.debug(`Total payments: ${totalPayments} ${tokenID}`)
} }