Skip to content

Commit

Permalink
feat: add WORKER_WATCH_DEBOUNCE
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschubek committed Nov 29, 2024
1 parent c3a5e85 commit 30bf2d4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
25 changes: 18 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ COPY server/php/php.ini /usr/local/etc/php/conf.d/custom.ini

COPY src/index.php /var/www/html

# skipped in v3.9
# COPY src/worker.php /var/www/html
COPY src/worker.php /var/www/html

COPY src/init.sh /init.sh

RUN chmod +x /init.sh

COPY src/fswatcher.sh /fswatcher.sh

RUN chmod +x /fswatcher.sh

ENV THEME=default

ENV DATE_FORMAT=relative
Expand Down Expand Up @@ -112,13 +115,21 @@ ENV BATCH_MAX_TOTAL_SIZE=500
ENV BATCH_MAX_FILE_SIZE=100
# MB, how much system disk space to keep free at all times
ENV BATCH_MIN_SYSTEM_FREE_DISK=500
# watch filesystem
# watch filesystem for changes (inotify)
ENV WORKER_WATCH=true
# seconds re-scan
ENV WORKER_SCAN_INTERVAL=60
# seconds auto re-scan. -1 for never
ENV WORKER_SCAN_INTERVAL=300
# manual rescan
ENV WORKER_FORCE_RESCAN=true
# password for triggering manual rescan
ENV WORKER_FORCE_RESCAN_KEY=
# by default only hashes again if modtime or size changed
ENV WORKER_ALWAYS_HASH=false

ENV WORKER_TTL_OFFSET=180

ENV WORKER_FORCE_RESCAN=
ENV WORKER_WATCH_DEBOUNCE=5

EXPOSE 8080

CMD ["/init.sh"]
ENTRYPOINT ["/init.sh"]
2 changes: 1 addition & 1 deletion src/fswatcher.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Debounce time in seconds
DEBOUNCE_TIME=5
DEBOUNCE_TIME=$WORKER_WATCH_DEBOUNCE

# Declare an associative array to track timers
declare -A file_timers
Expand Down

0 comments on commit 30bf2d4

Please sign in to comment.