From 4444e26c08e62380f0333b02037bb31a23ef83a7 Mon Sep 17 00:00:00 2001 From: glmdev Date: Sun, 10 Feb 2019 02:11:21 -0600 Subject: [PATCH] add stop control --- .idea/workspace.xml | 10 +++++----- index.py | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d327a4a..abbaa44 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -15,8 +15,8 @@ - - + + @@ -201,7 +201,7 @@ - + @@ -287,8 +287,8 @@ - - + + diff --git a/index.py b/index.py index 817fe92..06d4f21 100644 --- a/index.py +++ b/index.py @@ -52,5 +52,7 @@ while True: poll() doc_conf = db.collection('configurations').document(os.getenv('CONFIG_CODE')).get().to_dict() print(doc_conf) + if doc_conf['stop']: + break poll_time = float(doc_conf['frequency']) time.sleep(poll_time - ((time.time() - start_time) % poll_time))