diff options
Diffstat (limited to 'debian/python3-django-ishtar.postinst')
| -rw-r--r-- | debian/python3-django-ishtar.postinst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/debian/python3-django-ishtar.postinst b/debian/python3-django-ishtar.postinst index f892eaddd..bd10818e1 100644 --- a/debian/python3-django-ishtar.postinst +++ b/debian/python3-django-ishtar.postinst @@ -41,7 +41,7 @@ case "$1" in instances="$( (cat $INSTANCES_FILE 2>/dev/null || true) | xargs )" if [ -n "$instances" ]; then if [ -f /usr/sbin/rabbitmqctl ]; then # assume queues are configured - cecho c "Verify rabbitmq queues are empty" + cecho c "Verify rabbitmq queues are empty and no import is currently running" for instance in $instances; do for res in `rabbitmqctl list_queues -p /ishtar$instance -q messages`; do if [ $res != 0 ] && [ $res != 'messages' ]; then @@ -49,6 +49,12 @@ case "$1" in cecho y "Wait a few minutes (hours?) for update." exit 1 fi; + NB_IMPORT=$(sudo su - postgres -c "/usr/bin/psql -X -A -t -d ishtar-$instance -c \"SELECT count(id) FROM ishtar_common_import WHERE state IN ('IP', 'IQ')\"") + if [ $NB_IMPORT != '0' ]; then + cecho r "There are imports on $instance." + cecho y "Wait a few minutes (hours?) for update." + exit 1 + fi; done done fi |
