Update docker event query to filter events.
This commit is contained in:
parent
58ce939c40
commit
f1c2a7dbb3
1 changed files with 7 additions and 7 deletions
|
@ -38,16 +38,16 @@ update_templates() {
|
||||||
# Initial Generation
|
# Initial Generation
|
||||||
update_templates
|
update_templates
|
||||||
|
|
||||||
# cannot filter because reailine no longer recognized lines otherwise (check how IFS changes)
|
LAST_CHECK="$(date +%s)"
|
||||||
query_docker "events" | while true
|
while true
|
||||||
do
|
do
|
||||||
|
EVENTS=""
|
||||||
printf '%s | Listening for docker events\n' "$(get_date)"
|
printf '%s | Listening for docker events\n' "$(get_date)"
|
||||||
read -r;
|
while [ -z "${EVENTS}" ]
|
||||||
# wait for related events to finish
|
|
||||||
printf '%s | Waiting for event messages to settle.\n' "$(get_date)"
|
|
||||||
while [ $? -eq 0 ]
|
|
||||||
do
|
do
|
||||||
read -t 8 -r
|
NEXT_CHECK="$(($(date +%s) + 5))"
|
||||||
|
EVENTS=$(query_docker 'events' "?since=${LAST_CHECK}&until=${NEXT_CHECK}&filters={%22event%22:[%22die%22,%22kill%22,%22oom%22,%22pause%22,%22restart%22,%22start%22,%22stop%22,%22unpause%22,%22update%22]}")
|
||||||
|
LAST_CHECK="${NEXT_CHECK}"
|
||||||
done
|
done
|
||||||
printf '%s | Checking for changes in container label list.\n' "$(get_date)"
|
printf '%s | Checking for changes in container label list.\n' "$(get_date)"
|
||||||
update_templates
|
update_templates
|
||||||
|
|
Loading…
Reference in a new issue