Currently, all translations are performed using the Batch API, which doesn't allow for the use of the module to be used with translation via Cron runs.

To reproduce this, set up a continuous worker and then set translations to be run via Cron instead of on save, via the settings. When the cron runs, all items will be stuck in In Progress and the job will become stuck in the batch table.

The following patch was quickly put together to detect if the `requestJobItemsTranslation()` method is being called via `tmgmt_cron`, if it is, then the job is queued via a Cron Queue worker process.

When the Cron Queue worker process runs, it simply bundles up the original request items and hands them off to the batch methods to perform the translations, as if being run via the Batch API.

Some testing has been performed with success so far.

Comments

leslie.cordell created an issue. See original summary.

leslie.cordell’s picture

steffenr’s picture

@leslie.cordell
Thanks for supplying a patch.
I'll have a deeper look at it, when i find some time after my holidays. But the code looks fine so far..

  • SteffenR committed 24df5022 on 2.1.x
    Issue #3374373 by leslie.cordell, SteffenR: Allow translation via a cron...
steffenr’s picture

Status: Active » Fixed

  • SteffenR committed 24df5022 on 2.2.x
    Issue #3374373 by leslie.cordell, SteffenR: Allow translation via a cron...

Status: Fixed » Closed (fixed)

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