mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
feat: Migrate watcher to use watchfiles library
The `watchfiles` library supports event batching, which allows us to process multiple filesystem changes in a single run. This change also avoids database calls in the watcher as much as possible.
This commit is contained in:
@@ -201,11 +201,9 @@ start_bin_rq_worker() {
|
||||
|
||||
start_bin_watcher() {
|
||||
info_log "Starting watcher"
|
||||
watchmedo shell-command \
|
||||
--patterns='**/*' \
|
||||
--ignore-patterns='.DS_Store' \
|
||||
--recursive \
|
||||
--command='uv run python watcher.py "${watch_src_path}" "${watch_dest_path}" "${watch_event_type}" "${watch_object}"' \
|
||||
watchfiles \
|
||||
--target-type command \
|
||||
'uv run python watcher.py' \
|
||||
/romm/library &
|
||||
WATCHER_PID=$!
|
||||
echo "${WATCHER_PID}" >/tmp/watcher.pid
|
||||
|
||||
Reference in New Issue
Block a user