Skip to content

Commit e75b3d2

Browse files
authored
Create health.sh
1 parent 88951d2 commit e75b3d2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

health.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
last_msg_delay=${LAST_MSG_DELAY:-30}
4+
now=$(date +%s)
5+
last_time=$(cat last_msg)
6+
echo "Time since last message: $(expr $now - $last_time) seconds"
7+
if [[ $(expr $now - $last_time) -gt $last_msg_delay ]]; then
8+
exit 1
9+
fi

0 commit comments

Comments
 (0)