Job for updating translation memory. More...
Public Member Functions | |
__construct (Title $title, array $params=[]) | |
run () | |
Fetch all the translations and update them. | |
allowRetries () | |
@inheritDoc | |
setDelay (int $delay) | |
Set a delay for this job. | |
Static Public Member Functions | |
static | newJob (MessageHandle $handle, string $command) |
static | backoffDelay (int $errorCount) |
Protected Member Functions | |
resend (self $job) | |
Extracted for testing purpose. | |
getHandle () | |
Extracted for testing purpose. | |
getTranslation (MessageHandle $handle) | |
Extracted for testing purpose. | |
Protected Attributes | |
const | MAX_ERROR_RETRY = 4 |
Number of retries allowed, 4 means we attempt to run the job 5 times (1 initial attempt + 4 retries). | |
const | WRITE_BACKOFF_EXPONENT = 7 |
Constant used by backoffDelay(). | |
Job for updating translation memory.
job params:
This job handles retries itself and return false in allowRetries to disable JobQueue's internal retry service.
Definition at line 33 of file TtmServerMessageUpdateJob.php.
MediaWiki\Extension\Translate\TtmServer\TtmServerMessageUpdateJob::__construct | ( | Title | $title, |
array | $params = [] ) |
Definition at line 54 of file TtmServerMessageUpdateJob.php.
MediaWiki\Extension\Translate\TtmServer\TtmServerMessageUpdateJob::allowRetries | ( | ) |
@inheritDoc
Definition at line 79 of file TtmServerMessageUpdateJob.php.
|
static |
int | $errorCount | The number of times the job has errored out. |
Definition at line 269 of file TtmServerMessageUpdateJob.php.
|
protected |
Extracted for testing purpose.
Definition at line 163 of file TtmServerMessageUpdateJob.php.
|
protected |
Extracted for testing purpose.
Definition at line 168 of file TtmServerMessageUpdateJob.php.
|
static |
Definition at line 50 of file TtmServerMessageUpdateJob.php.
|
protected |
Extracted for testing purpose.
Definition at line 136 of file TtmServerMessageUpdateJob.php.
MediaWiki\Extension\Translate\TtmServer\TtmServerMessageUpdateJob::run | ( | ) |
Fetch all the translations and update them.
Definition at line 70 of file TtmServerMessageUpdateJob.php.
MediaWiki\Extension\Translate\TtmServer\TtmServerMessageUpdateJob::setDelay | ( | int | $delay | ) |
Set a delay for this job.
Note that this might not be possible, the JobQueue implementation handling this job doesn't support it (JobQueueDB) but is possible for the high performance JobQueueRedis. Note also that delays are minimums - at least JobQueueRedis makes no effort to remove the delay as soon as possible after it has expired. By default, it only checks every five minutes or so. Note yet again that if another delay has been set that is longer then this one then the longer delay stays.
int | $delay | seconds to delay this job if possible |
Definition at line 250 of file TtmServerMessageUpdateJob.php.
|
protected |
Number of retries allowed, 4 means we attempt to run the job 5 times (1 initial attempt + 4 retries).
Definition at line 38 of file TtmServerMessageUpdateJob.php.
|
protected |
Constant used by backoffDelay().
With 7 the cumulative delay between the first and last attempt is between 8 and 33 minutes.
Definition at line 45 of file TtmServerMessageUpdateJob.php.