Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
a committed Jun 4, 2024
1 parent 0ee3f3b commit 3d3f312
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions signals-catch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from datetime import datetime

ASK_INPUT = True
SLEEP_SEC = 0
OUTPUT_FILE = '/tmp/sig' # Use `tail -f /tmp/sig` to monitor the process.

def log(msg, file=sys.stdout):
Expand Down Expand Up @@ -55,8 +56,8 @@ def signal_handler(signum, frame):
sys.exit()
else:
log(f'sleep {i}')
if echo_sleep:
time.sleep(1)
if SLEEP_SEC:
time.sleep(SLEEP_SEC)

i += 1

Expand Down

0 comments on commit 3d3f312

Please sign in to comment.