SatSale

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 4e418775b046ac9a3c1bf024d8659b2b3f141c63
parent 02ac078858ffbd7fb095b100ba9528b3b18037bd
Author: Nick <nick@nickfarrow.com>
Date:   Fri, 25 Mar 2022 12:20:56 +1100

Merge pull request #58 from SatSale/stayalive

stay alive
Diffstat:
Mconfig.toml | 5+++--
Mnode/bitcoind.py | 9++++++++-
Mnode/clightning.py | 5++++-
Mnode/lnd.py | 5++++-
4 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/config.toml b/config.toml @@ -63,8 +63,9 @@ payment_timeout = 3600 # Required confirmations for a payment required_confirmations = 2 -# Global connection attempts -connection_attempts = 3 +# Global connection attempts (Note: SatSale has 60s breaks after the 5th attempt) +# If you're getting worker timeouts, try launch with a long `--timeout`. +connection_attempts = 15 # Console log level (DEBUG, INFO, WARNING, ERROR) loglevel = "DEBUG" diff --git a/node/bitcoind.py b/node/bitcoind.py @@ -69,7 +69,10 @@ class btcd: except Exception as e: logging.error(e) - time.sleep(2) + if i < 5: + time.sleep(2) + else: + time.sleep(60) logging.info( "Attempting again... {}/{}...".format( i + 1, config.connection_attempts @@ -131,6 +134,10 @@ class btcd: except Exception as e: logging.error(e) + if i < 5: + time.sleep(2) + else: + time.sleep(60) logging.info( "Attempting again... {}/{}...".format( i + 1, config.connection_attempts diff --git a/node/clightning.py b/node/clightning.py @@ -49,7 +49,10 @@ class clightning: except Exception as e: logging.error(e) - time.sleep(2) + if i < 5: + time.sleep(2) + else: + time.sleep(60) logging.info( "Attempting again... {}/{}...".format( i + 1, config.connection_attempts diff --git a/node/lnd.py b/node/lnd.py @@ -56,7 +56,10 @@ class lnd: except Exception as e: logging.error(e) - time.sleep(2) + if i < 5: + time.sleep(2) + else: + time.sleep(60) logging.info( "Attempting again... {}/{}...".format( i + 1, config.connection_attempts