Fredy Ugarriza
Fredy Ugarriza

Reputation: 31

Execute mediawiki extension job periodically

I'm developing an extension for mediawiki. My extension needs to execute some database updating periodically (e.g. every 30 mins). Reading mediawiki manual I found there is a job queue implemented, but it does not have support for scheduling.

Is there any way to set a mediawiki extension job to execute periodically?

Upvotes: 2

Views: 207

Answers (2)

Tgr
Tgr

Reputation: 28160

This is not what a job queue is for; it is to run a task as soon as there are free resources. Create a maintenance script and use cron to run it periodically.

Upvotes: 2

Camille
Camille

Reputation: 176

The job works thanks wiki visits. Each n visits, a job is executed (n being configured in your LocalSettings.php).

It is probably not what you are looking for, but if you really want to purge this queue every 30 minutes, you can still use a cron job. For instance :

30 * * * * php ./maintenance/runJobs.php

Based on your short elements, I would propose instead to configure cron to execute one of the scripts of your extension, and explain the set up in your install documentation.

Upvotes: 0

Related Questions