Possible job double execution ?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Possible job double execution ?

Post by MikaelNazarenko » 12 Nov 2020, 10:56

Hi community! I got a potential question.

On my shop I usually set cronjob like this:

Code: Select all

* * * * * php /path/artisan aimeos:jobs "order/email/delivery order/email/payment order/email/voucher order/service/delivery"
it executes jobs each minute.

And question is: if some job started and it took more then 1 minute then the job will be started again ? And means double perform is possible, so some emails might be sent twice or something like this ?

Clarify this moment please, because I would not like to have such problems..

Thanks!

Code: Select all

aimeos/ai-admin-jqadm                 2019.10.6  Aimeos ai-admin-jqadm extension
aimeos/ai-admin-jsonadm               2019.10.2  Aimeos ai-admin-jsonadm extension
aimeos/ai-client-html                 2019.10.10 Aimeos ai-client-html extension
aimeos/ai-client-jsonapi              2019.10.2  Aimeos JSON API extension
aimeos/ai-controller-frontend         2019.10.3  Aimeos ai-controller-frontend extension
aimeos/ai-controller-jobs             2019.10.4  Aimeos ai-controller-jobs extension
aimeos/ai-gettext                     2019.10.1  Aimeos Gettext extension
aimeos/ai-laravel                     2019.10.2  Laravel adapter for Aimeos web shops and e-commerce solutions
aimeos/ai-payments                    2019.10.1  Payment extension for Aimeos web shops and e-commerce solutions
aimeos/ai-swiftmailer                 2019.10.1  SwiftMailer adapter for Aimeos web shops and e-commerce solutions
aimeos/aimeos-core                    2019.10.7  Full-featured e-commerce components for high performance online shops
aimeos/aimeos-laravel                 2019.10.1  Professional, full-featured and high performance Laravel e-commerce package for online shops and complex B2B projects

User avatar
aimeos
Administrator
Posts: 7865
Joined: 01 Jan 1970, 00:00

Re: Possible job double execution ?

Post by aimeos » 13 Nov 2020, 17:20

There may be a small chance because the processed orders are not locked and if the first cronjob needs very long, then the second one may send out e-mails that have been already process due to a race condition.

You can prevent that using techniques like described here:
https://bencane.com/2015/09/22/preventi ... xecutions/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply