[Utopian-IO] Revisions to the Moderation Payment Script
The moderation payment script has been revised to be more consistent regardless of how and when it's ran. The script is ran in a more intelligent way now when gathering statistics and to overall be more reliable.
Dates are now rounded to Thursday midnight UTC. If Thursday has passed, it will round to last Thursday, this is to ensure calculations are not made in the future and to ensure payments are made exactly to the 1 week mark, no more fluctuations. For example, if the day is currently Monday, it will round back in time to Thursday. This will guarantee consistent and accurate results in all the statistics being broadcasted and has some other advantages mentioned below.
Broadcasts are only made if the comment or vote isn't in the blockchain. For moderators that have bandwidth issues, this will allow the script to run more often than once without draining the voting power of the Utopian bot or needlessly broadcasting comment edits. This behavior can be overridden when running with
forcewhich will cause the script to always broadcast.
The total moderated stats is now calculated using the rounded date and excludes the pending posts. Previously it relied on the data in the database that gets updated on a cron. The statistical data resulted in inconsistent results.
Pull Request: https://github.com/utopian-io/api.utopian.io/pull/105
Posted on Utopian.io - Rewarding Open Source Contributors