diff options
author | makefu <github@syntax-fehler.de> | 2015-12-18 10:58:15 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-12-18 10:58:15 +0100 |
commit | ed1de450240582ce034ee5d0da918c236c3d199f (patch) | |
tree | f1b4ff5a2e4d3d88cdc990070b27770d17912967 /cac | |
parent | 2bc4a01f8728f75da90890b49d9a339b2a5c0720 (diff) |
cac: use sleep if always_update instead of inotify
Diffstat (limited to 'cac')
-rwxr-xr-x | cac | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -13,7 +13,7 @@ cac_resources_cache=${cac_resources_cache-$HOME/tmp/cac_resources_cache.json} cac_servers_cache=${cac_servers_cache-$HOME/tmp/cac_servers_cache.json} cac_tasks_cache=${cac_tasks_cache-$HOME/tmp/cac_tasks_cache.json} cac_templates_cache=${cac_templates_cache-$HOME/tmp/cac_templates_cache.json} - +update_interval=${update_interval-10} cac_secrets=${cac_secrets-$HOME/.secrets/cac} _load_secrets() { @@ -275,9 +275,15 @@ __cac_cli__waitstatus() { ;; esac - echo "$(date -Is) Waiting for status: $2; current status: $status ..." >&2 - - __cac_cli__waitforcacheupdate __cac_cli__waitstatus "$@" + # always_update is not compatible with inotifywait + if test -z "${always_update:-}";then + echo "$(date -Is) Waiting for status: $2; current status: $status ..." >&2 + __cac_cli__waitforcacheupdate __cac_cli__waitstatus "$@" + else + echo "$(date -Is) Waiting ${update_interval}secs for status: $2; current status: $status ..." + sleep ${update_interval} + __cac_cli__waitstatus "$@" + fi } |