Skip to content

Commit

Permalink
Merge pull request #696 from City-of-Helsinki/UHF-8525
Browse files Browse the repository at this point in the history
UHF-8525: PubSub cron
  • Loading branch information
tuutti authored Sep 5, 2023
2 parents 873542d + 563c925 commit 6ce0cdd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker/openshift/crons/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exec "/crons/purge-queue.sh" &
exec "/crons/update-translations.sh" &
exec "/crons/content-scheduler.sh" &
exec "/crons/invalidate-tags-kymp.sh" &
exec "/crons/pubsub.sh" &

while true
do
Expand Down
15 changes: 15 additions & 0 deletions docker/openshift/crons/pubsub.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

echo "Running PubSub daemon: $(date +'%Y-%m-%dT%H:%M:%S%:z')"

i=0
# Attempt to start this service five times.
until [ $i -gt 5 ]
do
drush helfi:azure:pubsub-listen

if [[ "$?" -ne 0 ]]; then
((i=i+1))
sleep 10
fi
done

0 comments on commit 6ce0cdd

Please sign in to comment.