From fe3e42e1d3eadd03f887278a7102d9197fbb6289 Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Thu, 12 Apr 2018 10:32:08 +0200 Subject: [PATCH] tip-kudos-recipients: Allow configurable payment periodicity --- bot_scripts/tip-kudos-recipients.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bot_scripts/tip-kudos-recipients.js b/bot_scripts/tip-kudos-recipients.js index a1dc7e6..22e23c9 100644 --- a/bot_scripts/tip-kudos-recipients.js +++ b/bot_scripts/tip-kudos-recipients.js @@ -19,6 +19,7 @@ const tipPerKudoInUsd = parseFloat(options.rules.tip_per_kudo_in_usd) const tipPerReactionInUsd = parseFloat(options.rules.tip_per_reaction_in_usd) const reactionThreshold = parseInt(options.rules.reaction_threshold) const interTransactionDelay = parseInt(options.options.inter_transaction_delay) +const paymentPeriodicityInDays = parseInt(options.options.payment_periodicity_in_days) const tokenID = process.env.DEBUG ? 'STT' : 'SNT' const token = options.payments[tokenID] @@ -37,7 +38,7 @@ module.exports = robot => { } setTimeout(() => processKudosChannelUpdates(robot), process.env.DISABLE_DELAY ? 1 * 1000 : 30 * 1000) - setInterval(() => processKudosChannelUpdates(robot), 24 * 60 * 60 * 1000) + setInterval(() => processKudosChannelUpdates(robot), paymentPeriodicityInDays * 24 * 60 * 60 * 1000) } function getOptions (optionsString) { @@ -224,7 +225,7 @@ async function processPendingPayments (robot, data, saveStateAsyncFunc) { } } } - robot.log.debug(`Total payments: ${totalPayments}`) + robot.log.debug(`Total payments: ${totalPayments} ${tokenID}`) } function compareBalances (userToPendingPayouts, a, b) {