Page MenuHomeGitPull.it

Execute job queue
Closed, ResolvedPublic2 Points

Description

Actually it's impossible to recover the password because there is not any job queue running.

Event Timeline

valerio.bozzolan triaged this task as Unbreak Now! priority.Mar 29 2020, 10:40
valerio.bozzolan created this task.

Implemented as follow:

informazioni_wiki_jobs.service
[Unit]
Description=MediaWiki Job runner

[Service]
ExecStart=/home/www-data/informazioni.wiki/cli/job.php
Nice=10
ProtectSystem=full
User=www-data
OOMScoreAdjust=200
StandardOutput=journal

[Install]
WantedBy=multi-user.target
job.php
#!/bin/sh

# Put the MediaWiki installation path on the line below
IP=/home/www-data/informazioni.wiki/wiki
EXEC_JOBS="php --file $IP/maintenance/runJobs.php -- --conf $IP/LocalSettings.php"
STARTUP_WAIT=60
INTERVAL=45

# Wait a minute after the server starts up to give other processes time to get started
echo "Starting job service in $STARTUP_WAIT seconds"
sleep $STARTUP_WAIT
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
	$EXEC_JOBS --type=enotifNotify

	# 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
	$EXEC_JOBS --wait --maxjobs=20

	# Wait some seconds to let the CPU do other things, like handling web requests, etc
	echo "Wait $INTERVAL seconds"
	sleep $INTERVAL
done
valerio.bozzolan closed this task as Resolved.Mar 29 2020, 11:24
valerio.bozzolan moved this task from Arriving to Done on the InformAzioni.wiki board.
valerio.bozzolan set the point value for this task to 2.Tue, Oct 6, 16:47