Adjust timing, settings
This commit is contained in:
7
main.py
7
main.py
@@ -9,11 +9,7 @@ import threading
|
|||||||
import requests
|
import requests
|
||||||
from inotify_simple import INotify, flags
|
from inotify_simple import INotify, flags
|
||||||
|
|
||||||
WATCH_PATHS = [
|
SCAN_DELAY_SECONDS = 10
|
||||||
'/tmp/watch-test',
|
|
||||||
]
|
|
||||||
|
|
||||||
SCAN_DELAY_SECONDS = 5
|
|
||||||
timer = None
|
timer = None
|
||||||
|
|
||||||
|
|
||||||
@@ -50,6 +46,7 @@ def main():
|
|||||||
logging.debug(f"Event: {event!r}")
|
logging.debug(f"Event: {event!r}")
|
||||||
if timer:
|
if timer:
|
||||||
timer.cancel()
|
timer.cancel()
|
||||||
|
logging.info('Debounce cancelled timer.')
|
||||||
timer = threading.Timer(SCAN_DELAY_SECONDS, trigger_scan)
|
timer = threading.Timer(SCAN_DELAY_SECONDS, trigger_scan)
|
||||||
timer.start()
|
timer.start()
|
||||||
logging.info(f"Modification detected. Triggering scan in {SCAN_DELAY_SECONDS} seconds.")
|
logging.info(f"Modification detected. Triggering scan in {SCAN_DELAY_SECONDS} seconds.")
|
||||||
|
|||||||
7
secrets.py.example
Normal file
7
secrets.py.example
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
IMMICH_API_KEY = ''
|
||||||
|
|
||||||
|
LIBRARY_UUID = ''
|
||||||
|
|
||||||
|
WATCH_PATHS = [
|
||||||
|
'/mnt/example/path',
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user