add stop control

This commit is contained in:
glmdev 2019-02-10 02:11:21 -06:00
parent 3032389846
commit 4444e26c08
2 changed files with 7 additions and 5 deletions

View File

@ -15,8 +15,8 @@
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/index.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="461">
<caret line="54" column="31" selection-start-line="54" selection-start-column="31" selection-end-line="54" selection-end-column="31" />
<state relative-caret-position="751">
<caret line="54" column="24" lean-forward="true" selection-start-line="54" selection-start-column="24" selection-end-line="54" selection-end-column="24" />
<folding>
<element signature="e#0#21#0" expanded="true" />
</folding>
@ -201,7 +201,7 @@
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="7" />
<window_info active="true" anchor="bottom" id="Terminal" order="8" visible="true" weight="0.32972974" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.32972974" />
<window_info anchor="bottom" id="Python Console" order="9" />
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
@ -287,8 +287,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/index.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="461">
<caret line="54" column="31" selection-start-line="54" selection-start-column="31" selection-end-line="54" selection-end-column="31" />
<state relative-caret-position="751">
<caret line="54" column="24" lean-forward="true" selection-start-line="54" selection-start-column="24" selection-end-line="54" selection-end-column="24" />
<folding>
<element signature="e#0#21#0" expanded="true" />
</folding>

View File

@ -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))