Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

Commit

Permalink
Add etp-payout-autoheal
Browse files Browse the repository at this point in the history
  • Loading branch information
NotoriousPyro committed Sep 26, 2018
1 parent 9b8d8d1 commit bad40bf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -45,4 +45,8 @@ Now just start the services you added using:

If you get errors, please check folder permissions, missing folders, wallet is running, ports are open, and other common problems PRIOR to raising an issue. Issues raised with no prior debugging will be closed.

To build the Orchestrator, use <code>make</code> after a fresh install or when you make a change.
To build the Orchestrator, use <code>make</code> after a fresh install or when you make a change.

You can also set an entry in crontab for <code>misc/etp-payout-autoheal.sh</code> for if Redis is locked without pending payments. **Make sure you edit the file to set the correct "coin" that you have in the <code>.json</code> files and the right service name**

* * * * * /opt/scripts/etp-payout-autoheal.sh
13 changes: 13 additions & 0 deletions misc/etp-payout-autoheal.sh
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

PAYMENTS="etp:payments"
SERVICE="oep-etp-payouts"

systemctl -n 1 status $SERVICE | grep -i "payments suspended"
if [ $? -eq 0 ]; then
grep -i "(empty list or set)" <<< $(redis-cli --no-raw ZREVRANGE "$PAYMENTS:pending" 0 -1 WITHSCORES)
if [ $? -eq 0 ]; then
redis-cli DEL "$PAYMENTS:lock"
systemctl restart $SERVICE
fi
fi

0 comments on commit bad40bf

Please sign in to comment.