When quotas are exceeded in Google continous items won't be retried

Created on 7 April 2025, 12 days ago

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.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

achap 🇦🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024