diff options
author | dennis <d@ennis.no> | 2023-02-04 07:28:00 +0100 |
---|---|---|
committer | dennis <d@ennis.no> | 2023-02-04 07:28:00 +0100 |
commit | b5319ac549f0f2a43e143f8a447f63a10d3f0ec5 (patch) | |
tree | 2afb7a42ce71326aa2889c3e3ced387203e9ccff /scripts/queue_runner.py | |
parent | fixing some lintingthings (diff) | |
download | energyscripts-b5319ac549f0f2a43e143f8a447f63a10d3f0ec5.tar.gz |
queue sleep as variable
Diffstat (limited to 'scripts/queue_runner.py')
-rw-r--r-- | scripts/queue_runner.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/queue_runner.py b/scripts/queue_runner.py index fd4812e..62467b5 100644 --- a/scripts/queue_runner.py +++ b/scripts/queue_runner.py @@ -10,6 +10,7 @@ from litequeue import SQLQueue from common.postgres import dbi QUEUE_DB = os.environ.get('el_QUEUE_db', 'litequeue.db') +QUEUE_SLEEP = int(os.environ.get('el_QUEUE_sleep', 15)) # Default sleep 15 seconds when queue empty # Unlock all con = sqlite3.connect(QUEUE_DB) @@ -31,7 +32,7 @@ i = 0 while True: # Just sleep if queue is empty if q.empty() is True: - time.sleep(10) + time.sleep(QUEUE_SLEEP) continue # get message |