2

I have created a scheduled rule that sends a email based on a date field in nodes of a certain content type. The rule executes as scheduled and the email is sent but for some reason it only fires exactly a hour after its supposed to.

E.g on the admin/config/workflow/rules/schedule page the item is scheduled to execute at Thu, 2017-08-03 15:30 but I only receive the email at 16:30.

I could fix this by adding a offset to the trigger time but I would rather want to understand why this is happening and fix the problem accordingly.

1 Answer 1

1

Cause 1:

After a rule is scheduled (using the Rules Scheduler submodule), it will only actually execute next time cron runs. Example:

  • schedule a rule to execute at timestamp X.
  • if the next time that cron runs is at Y mins after timestamp X, then the Rules execution will only happen then (= at Y mins after timestamp X).

Cause 2:

If your site is set to the correct timezone, but your users are set to a timezone that is 1 hour ahead, then that might also explain what's happening. In that case, correct the timezone accordingly.

3
  • 1
    To add to this answer, you should consider using Ultimate Cron as this will allow you to run specific cron tasks at different time intervals rather than using the default Drupal Core cron, which runs all cron tasks every x hours.
    – No Sssweat
    Aug 3, 2017 at 18:39
  • @NoSssweat good point! why not convert your comment to an extra answer (gives you way more space to elaborate on it also) ... Aug 3, 2017 at 19:11
  • Thanks for the invite, but I think this is fine.
    – No Sssweat
    Aug 3, 2017 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.