Browse Source

Merge pull request #3 from lncm/configurable-sleep-time

Make the polling time customizable, and document how to customize it
master
BT 4 years ago
committed by GitHub
parent
commit
547a45b264
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      README.md
  2. 9
      switch.sh

1
README.md

@ -27,3 +27,4 @@ Other than that everything should be in the default paths.
- JSONRPCURL (Default: http://10.254.2.2:8332) : Is the JSON-RPC interface for bitcoind
- LND_CONTAINER_NAME (Default: lnd) : is the container name to restart
- SLEEPTIME (Default: 3600) : Configures how often to poll. Ideally we should set this high so we minimize disruptions, but we might want to set it lower for testing.

9
switch.sh

@ -17,6 +17,11 @@
# Then
PASSWORD=`cat /secrets/rpcpass.txt`
# If sleeptime isn't set, set it to 3600 (1 hour)
if [ -z $SLEEPTIME ]; then
SLEEPTIME=3600
fi
# If JSONRPCURL doesn't exist then set it
if [ -z $JSONRPCURL ]; then
JSONRPCURL="http://10.254.2.2:8332"
@ -83,6 +88,6 @@ while true; do
#TODO: Lets maybe try to switch back
fi
# Run every every 1 hour
sleep 3600
# Run every every 1 hour by default or as per configurable
sleep $SLEEPTIME
done

Loading…
Cancel
Save