Skip to content

Commit e9190e5

Browse files
authored
Merge pull request #7 from andersinno/run-test-workers-script
Improve the test worker run script (run_test.sh)
2 parents ef70f27 + 43d377f commit e9190e5

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

run_test.sh

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
#!/bin/bash
2+
# Run the RQ workers in the background for testing purposes.
3+
#
4+
# Note: This script is intended for testing purposes only. In
5+
# production the workers should be started with a process manager like
6+
# systemd.
7+
28
rq worker download_object &
39
rq worker create_sip &
410
rq worker submit_sip &
5-
echo "Press anything to shutdown the workers";
6-
read -n 1
7-
killall -s TERM rq
11+
12+
# Wait a bit for workers to start and stop outputting to console
13+
sleep 1
14+
15+
printf "\nWorkers started:\n%s\n\n" "$(jobs -l)"
16+
printf "Press Ctrl+C to shutdown the workers.\n"
17+
while true; do sleep 10; done
18+
19+
# Note: Workers will stop when the script is terminated with Ctrl+C
20+
# because they are background jobs and the script is the parent process.

0 commit comments

Comments
 (0)