Skip to content

Commit a910d32

Browse files
committed
feat: add queue and schedule
1 parent e0a60fa commit a910d32

File tree

13 files changed

+47
-0
lines changed

13 files changed

+47
-0
lines changed

8.4/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ ENV COMPOSER_NO_INTERACTION=1
4141
# App defaults
4242
ENV LOG_CHANNEL=stderr
4343

44+
# Schedule settings
45+
ENV SCHEDULE_ENABLED=true
46+
47+
# Queue settings
48+
ENV QUEUE_ENABLED=false
49+
ENV QUEUE_MAX_JOBS=50
50+
ENV QUEUE_SLEEP=30
51+
ENV QUEUE_REST=1
52+
ENV QUEUE_TIMEOUT=600
53+
ENV QUEUE_TRIES=3
54+
4455
# Switch to root so we can do root things
4556
USER root
4657

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
healthcheck-queue
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
php-fpm
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SIGTERM
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/command/with-contenv sh
2+
3+
echo "QUEUE_ENABLED $QUEUE_ENABLED"
4+
5+
if test "$QUEUE_ENABLED" -eq "true"; then
6+
artisan queue:work \
7+
--max-jobs $QUEUE_MAX_JOBS \
8+
--sleep $QUEUE_SLEEP \
9+
--rest $QUEUE_REST \
10+
--timeout $QUEUE_TIMEOUT \
11+
--tries $QUEUE_TRIES \
12+
--force
13+
else
14+
echo "Queue is disabled"
15+
s6-svc -Od .
16+
exit 0
17+
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
longrun
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
healthcheck-schedule
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
php-fpm
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SIGTERM
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/command/with-contenv sh
2+
3+
echo "SCHEDULE_ENABLED $SCHEDULE_ENABLED"
4+
5+
if test "$SCHEDULE_ENABLED" -eq "true"; then
6+
artisan schedule:work --whisper
7+
else
8+
echo "Schedule is disabled"
9+
s6-svc -Od .
10+
exit 0
11+
fi

0 commit comments

Comments
 (0)