Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created December 17, 2020 11:30
Show Gist options
  • Save velotiotech/9200240786c9087cf7880d60a5c3885b to your computer and use it in GitHub Desktop.
Save velotiotech/9200240786c9087cf7880d60a5c3885b to your computer and use it in GitHub Desktop.
deploy on change thread
def deploy_service_on_change():
while True:
if EventHandler.last_update_time and (int(time.time() - EventHandler.last_update_time) > DEPLOY_AFTER_CHANGE_SEC):
EventHandler.last_update_time = None
deploy_env()
time.sleep(5)
def start_interval_watcher_thread():
interval_watcher_thread = threading.Thread(target=deploy_service_on_change)
interval_watcher_thread.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment