We have a quota for our sites to avoid spending too much money. When we translate continuous job items they are put in the active state when translations are requested but if the API returns a resource exhaustion the job item's state never gets set back to inactive. tmgmt's cron only looks for inactive items, so it is never gets reprocessed:
// Submit continuous job items.
$tmgmt_settings = \Drupal::config('tmgmt.settings');
if ($tmgmt_settings->get('submit_job_item_on_cron')) {
// Look for inactive job items of continuous jobs.
$ids = \Drupal::entityQuery('tmgmt_job_item')
->accessCheck(TRUE)
->condition('tjid.entity.job_type', JobInterface::TYPE_CONTINUOUS)
->condition('state', JobItemInterface::STATE_INACTIVE)
->range(0, $tmgmt_settings->get('job_items_cron_limit'))
->sort('tjiid')
->execute();
As it's not an error but a quota limit, the job item should be set back to inactive so it can get tried again later.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3517644_4.patch | 2.36 KB | achap |
Issue fork tmgmt_google_v3-3517644
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3517644-when-quotas-are
changes, plain diff MR !4
Comments
Comment #2
achapComment #4
achapUploading patch from the MR. Currently the only way to retry the jobs is to write an update hook to reset the job state. Patch can be tested by setting "v2 and v3 general model characters per minute" quota to something really small e.g. 1
Comment #6
kallado commented@achap commited
Comment #7
kallado commentedComment #9
kallado commentedFixed in 1.0.5