From 9d3afcd801f96cc422168270af4e3e37ac7ae2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Ole=20Hu=CC=88bner?= Date: Sun, 18 Aug 2024 01:18:19 +0200 Subject: [PATCH] change timing --- get_price.py | 2 +- pulse.py | 2 +- start.sh | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/get_price.py b/get_price.py index 56d9aca..a41a2c6 100644 --- a/get_price.py +++ b/get_price.py @@ -21,7 +21,7 @@ ch.setFormatter(formatter) logger.addHandler(ch) logger.setLevel(logging.INFO) -__version__ = "v0.3.0" +__version__ = "v0.4.0" logger.info(__version__) client = InfluxDBClient(url=URL, token=TOKEN, org=ORG) diff --git a/pulse.py b/pulse.py index 338a4a1..cd08f9f 100644 --- a/pulse.py +++ b/pulse.py @@ -25,7 +25,7 @@ ch.setFormatter(formatter) logger.addHandler(ch) logger.setLevel(logging.INFO) -__version__ = "v0.3.4" +__version__ = "v0.4.0" logger.info(__version__) diff --git a/start.sh b/start.sh index 4a78868..1ac5d74 100644 --- a/start.sh +++ b/start.sh @@ -2,13 +2,15 @@ python3 /app/pulse.py & -# Run the other script periodically in the background +# Run the other script at 0, 15, 30, 45, and 60 minutes ( while true; do - python3 /app/get_price.py - sleep 900 + current_minute=$(date +'%M') + if [[ "$current_minute" == "00" || "$current_minute" == "15" || "$current_minute" == "30" || "$current_minute" == "45" || "$current_minute" == "00" ]]; then + python3 /app/get_price.py + fi + sleep 60 # Check every minute done ) & - wait -n