- Issue created by @cafuego
- π¦πΊAustralia cafuego
I have a patch for a work-around, but I'm not sure if this isn't a bad idea :-)
class AmazonSesMailQueue extends QueueWorkerBase implements ContainerFactoryPluginInterface { use HandlerTrait; /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { $instance = new static( $configuration, $plugin_id, $plugin_definition ); // Only set the handler if queueing is enabled to avoid an error when // trying to run without config. $enabled = \Drupal::config('amazon_ses.settings')->get('queue'); if ($enabled) { $instance->setHandler($container->get('amazon_ses.handler')); } return $instance; }
- Merge request !14#3417090: Do not try to create a queue instance when not configured for queueing. β (Merged) created by cafuego
- last update
12 months ago CI error - Status changed to Needs review
8 months ago 1:43am 20 June 2024 - last update
8 months ago 16 pass - First commit to issue fork.
- πΊπΈUnited States davisben NH
davisben β changed the visibility of the branch 3417090 to hidden.
- πΊπΈUnited States davisben NH
I took a different approach by implementing hook_queue_info_alter() to remove the mail queue from cron when it's not enabled. Could you give this a test and see if it works as you expect it to?
- Status changed to Needs work
27 days ago 7:46am 28 January 2025 - π―π΅Japan orakili
@davisben
Thanks for the proposed change. It's currently not working because `amazon_ses_hook_queue_info_alter()` should be `amazon_ses_queue_info_alter()`.
With the proper function name, the queue is indeed not processed during cron when queueing is not enabled and processed otherwise.
-
davisben β
committed 8dbccce2 on 3.0.x authored by
cafuego β
#3417090: Do not try to create a queue instance when not configured for...
-
davisben β
committed 8dbccce2 on 3.0.x authored by
cafuego β
- π¦πΊAustralia cafuego
Hmm, does this need to get ported to 3.1.x as well?
-
davisben β
committed 02e356c6 on 3.x authored by
cafuego β
#3417090: Do not try to create a queue instance when not configured for...
-
davisben β
committed 02e356c6 on 3.x authored by
cafuego β
- πΊπΈUnited States davisben NH
Sure does. I just cherry picked it to 3.x. Thanks!