Simple Solution to Fix the Voting Program

in #blog15 days ago

Previously, the voting services were not stable - with some votes missing. I have now tried a few improvements and let it run a few days, and it turns out it is quite stable now.

So TLDR; the solution is:

  1. moving to a better VPS provider i.e. hetzner
  2. run the voting service continuously in a screen session rather than a crontab.
  3. timeout the program in case it got stuck.

See following:

#!/bin/bash

i=0
while :
do
        i=$((i+1))
        date
        echo ---------------Counter $i------------------
        timeout 1200 node voting.js
        sleep 5
done

Steem to the Moon🚀!

Coin Marketplace

STEEM 0.28
TRX 0.11
JST 0.031
BTC 69118.60
ETH 3805.70
USDT 1.00
SBD 3.71