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.

CommentFileSizeAuthor
#4 3517644_4.patch2.36 KBachap
Command icon 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:

Comments

achap created an issue. See original summary.

achap’s picture

Title: When quotas are exceeded in Google continous items won't be retried » When quotas are exceeded in Google continuous items won't be retried

achap’s picture

Status: Active » Needs review
StatusFileSize
new2.36 KB

Uploading 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

  • kallado committed 39524b4a on 1.0.x
    [#3517644] feat: When quotas are exceeded in Google continuous items won...
kallado’s picture

@achap commited

kallado’s picture

Status: Needs review » Reviewed & tested by the community

kallado’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in 1.0.5

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.