summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <contact@sinitax.com>2025-04-23 21:14:52 +0200
committerLouis Burda <contact@sinitax.com>2025-04-23 21:14:52 +0200
commit42f34eef8d5d7026bfa143f217d2c0924e8d5c30 (patch)
tree35ff9f97f2f639855e81dad78ec2b5f65efc3a1d
parenta9cdf326c3361e1a50efff2b9b7a990fa239e77b (diff)
downloadgit-sync-42f34eef8d5d7026bfa143f217d2c0924e8d5c30.tar.gz
git-sync-42f34eef8d5d7026bfa143f217d2c0924e8d5c30.zip
Enforce timeout with timeout command
-rwxr-xr-xgit-syncd5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-syncd b/git-syncd
index 5f773c3..db1d7a5 100755
--- a/git-syncd
+++ b/git-syncd
@@ -27,8 +27,9 @@ watcher() {
sync "$repo"
timeout=$sync_timeout
while true; do
- file=$(inotifywait "$repo" -r -e modify,move,create,delete \
- --exclude '\.git' ${excludes[@]} -t "$timeout" 2>/dev/null)
+ file=$(timeout "$timeout" inotifywait "$repo" -r \
+ -e modify,move,create,delete --exclude '\.git' \
+ ${excludes[@]} 2>/dev/null)
if [ ! -z "$file" ]; then
echo "inotify wake: $file"
timeout=$sync_delay