Initial commit
This commit is contained in:
commit
2eff037f6b
16 changed files with 431 additions and 0 deletions
scripts
23
scripts/mwjobrunner
Normal file
23
scripts/mwjobrunner
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# From https://www.mediawiki.org/wiki/Manual:Job_queue
|
||||
IP=/var/www/html
|
||||
RJ=$IP/maintenance/runJobs.php
|
||||
echo Starting job service...
|
||||
# Wait a minute after the server starts up to give other processes time to get started
|
||||
sleep 60
|
||||
echo Started.
|
||||
while true; do
|
||||
# Job types that need to be run ASAP mo matter how many of them are in the queue
|
||||
# Those jobs should be very "cheap" to run
|
||||
php $RJ --type="enotifNotify"
|
||||
php $RJ --type="htmlCacheUpdate" --maxjobs=50
|
||||
# Everything else, limit the number of jobs on each batch
|
||||
# The --wait parameter will pause the execution here until new jobs are added,
|
||||
# to avoid running the loop without anything to do
|
||||
php $RJ --wait --maxjobs=10
|
||||
# Wait some seconds to let the CPU do other things, like handling web requests, etc
|
||||
echo Waiting for 10 seconds...
|
||||
sleep 10
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue