Skip to content

Commit

Permalink
WIP watchfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
jheld committed Jan 3, 2024
1 parent 7831109 commit ed37473
Show file tree
Hide file tree
Showing 3 changed files with 1,185 additions and 87 deletions.
5 changes: 5 additions & 0 deletions diycrate/diycrate_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from diycrate.cache_utils import r_c
from diycrate.file_operations import (
EventHandler,
watch_wrapper,
wm,
in_moved_to,
in_moved_from,
Expand Down Expand Up @@ -77,6 +78,8 @@
notifier = pyinotify.ThreadedNotifier(wm, handler, read_freq=file_notify_read_freq)
notifier.coalesce_events()

watch_thread = threading.Thread(target=watch_wrapper)


# only re-enable when wishing to test token refresh or access dance
# @app.get('/kill_tokens/', response_class=fastapi.responses.PlainTextResponse)
Expand Down Expand Up @@ -353,6 +356,8 @@ def main():
file_event_handler=handler,
)
notifier.start()
watch_thread._args = (BOX_DIR, trash_directory.as_posix(), oauth, app, wait_time)
watch_thread.start()
# notifier_thread = threading.Thread(target=notifier.loop)
# notifier_thread.daemon = True
# notifier_thread.start()
Expand Down
Loading

0 comments on commit ed37473

Please sign in to comment.