Commit Graph

15 Commits

Author SHA1 Message Date
c67c58709b Unify spacing of declare statements
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
4d7f6f8c75 Use more effective method deactivation
This will cancel all jobs with one query. Instead of cancelling one by one.
In case that some action gets scheduled multiple times e.g. due a race condition
it will remove all jobs.
2022-10-13 14:21:43 +02:00
c44758b90d Refactor action scheduler deactivation into DaemonActionSchedulerRunner::init
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
16807fe9e3 Update and fix comments related to usage of Action Scheduler in cron
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
977f9beb87 Refactor deactivation of MailPoet cron actions to run only once
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
d3e2bcdf34 Refactor daemon trigger and daemon run actions to extra classes
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
476ee1ede9 Refactor triggering new action scheduler executor into extra service
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
bb1d461c54 Fix code formatting issues in ActionSchedulerRunner class
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
dfae17ed94 Add missing return and parameter types to action scheduler related classes
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
2ba1696d53 Add adaptive execution limit when daemon runs inside Action Scheduler
We use action_scheduler_maximum_execution_time_likely_to_be_exceeded filter for reading remaining execution limit
tracked in the Action Scheduler runner.
Then we use the remaining limit minus safety margin for the daemon execution.

[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
91e72ee646 Lower execution limit of daemon in case it runs in action scheduler
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
b525f9f876 Deactivate action scheduler actions when another method is active
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
86562e99b9 Trigger additional executor only when MailPoet daemon runs
In afterProcess callback we trigger a new runner when there are still some scheduled tasks
to process. Before this change we did this for every action scheduler run and it was causing that
we triggered more HTTP requests than needed.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
f59945d483 Add wrapper class for action scheduler in cron
The class add GROUP ID so that all MailPoet cron tasks are stored under the same group.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
ccfdd229ec Add action scheduler daemon runner
This commit adds a class that handles continuous processing of MailPoet cron daemon
using Action Scheduler's recurring actions.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00