We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b65d825 commit 3622274Copy full SHA for 3622274
nodeapp_debounce.sh
@@ -0,0 +1,26 @@
1
+#!/bin/bash
2
+LOCKFILE="/tmp/nodeapp_debounce.lock"
3
+TIMEOUT=5
4
+
5
+# Check if lockfile exists
6
+if [ -e "$LOCKFILE" ]; then
7
+ touch "$LOCKFILE" # Update lockfile timestamp
8
+ exit 1
9
+fi
10
11
+# Create lockfile
12
+touch "$LOCKFILE"
13
14
+# Ensure lockfile is removed on script exit
15
+trap 'rm -f "$LOCKFILE"' EXIT
16
17
+# Wait until the lockfile is $TIMEOUT seconds old
18
+while [ $(( $(date +%s) - $(stat -c %Y "$LOCKFILE") )) -lt $TIMEOUT ]; do
19
+ sleep 1
20
+done
21
22
+# Your script logic goes here
23
+/usr/local/hestia/bin/v-invoke-plugin nodeapp_debounce
24
25
+# Lockfile will be removed automatically due to trap
26
+exit 0
0 commit comments