Simple Solution to Fix the Voting Program

in #blog28 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.25
TRX 0.11
JST 0.029
BTC 69398.84
ETH 3695.07
USDT 1.00
SBD 3.32