Commit Graph

16 Commits

Author SHA1 Message Date
ff5a41a8ee Update outdated comment about recurring action in Daemon Run action
[MAILPOET-4684]
2022-10-13 14:21:43 +02:00
05b441378d Add logging of suspiciously terminated cron runs
[MAILPOET-4684]
2022-10-13 14:21:43 +02:00
9c0ce5ed7a Refactor DaemonRun::afterProcess for better readability
[MAILPOET-4684]
2022-10-13 14:21:43 +02:00
de22257af3 Do not schedule next action scheduler run after suspiciously short run
In case we still have work to do but the previous run ended too early and it still had some execution time left
we will not schedule new action.
This is prevention for creating a run action every one second in case there is e.g. some stuck job.
Next run will be triggered within the trigger action that runs every 2 minutes.
[MAILPOET-4684]
2022-10-13 14:21:43 +02:00
a03f8f1c30 Use action scheduler's unique single action for daemon run
With the new unique parameter added in the action scheduler 3.5.0 the
as_schedule_single_action that schedules an immediate action
seems to be more convenient for the action scheduler.
We get better control over the scheduling of subsequent runs.
Note: We don't want to use the async action that is also executed immediately,
but it has the highest priority and we don't want to block actions scheduled by other plugins.
[MAILPOET-4684]
2022-10-13 14:21:43 +02:00
1711d60871 Schedule recurring actions as unique to prevent duplicate actions
We had some cases of multiple triggers created most probably because of a race conditions.
The unique action functionality added in the action scheduled 3.5.0 should prevent it.
[MAILPOET-4684]
2022-10-13 14:21:43 +02: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
45e1db5893 Make trigger run less frequent
Checking if there are task to execute every 2 minutes should be enough.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
db254986ee Fix initial trigger scheduling
When scheduling using timestamp the action scheduler uses default UTC timezone
See 0a294e6df6/functions.php (L330-L339)
[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
d742164f21 Allow execution limit type to be float
[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
dfae17ed94 Add missing return and parameter types to action scheduler related classes
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
cacb44444c Add DaemonActionSchedulerRunner integration test
[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