-
Notifications
You must be signed in to change notification settings - Fork 38
/
workers.sh
37 lines (21 loc) · 890 Bytes
/
workers.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
while [ true ]
do
queues=$(ps aux| grep -v grep| grep "queue:work database --queue=listeners" | wc -l);
if [ "$queues" -lt "1" ]; then
php artisan queue:work database --queue=listeners --sleep=3 > notify.log &
fi
queues=$(ps aux| grep -v grep| grep "queue:work database --queue=discovery" | wc -l);
if [ "$queues" -lt "3" ]; then
php artisan queue:work database --queue=discovery --sleep=3 > discovery.log &
fi
queues=$(ps aux| grep -v grep| grep "queue:work database --queue=resource" | wc -l);
if [ "$queues" -lt "5" ]; then
php artisan queue:work database --queue=resource --sleep=3 > resource.log &
fi
queues=$(ps aux| grep -v grep| grep "queue:work database --queue=analyze" | wc -l);
if [ "$queues" -lt "2" ]; then
php artisan queue:work database --queue=analyze --sleep=3 > resource.log &
fi
php artisan schedule:run
sleep 60
done