3

I'm using Magento version 2.2.5 and I've created a cron job for my custom module, but it's often missed, first I setup the cron to run every 5 minutes

<group id="default"> 
  <job instance="Custom\Module\Cron\SyncTransaction" method="execute" name="lime_sepulsa_synctransaction">
    <schedule>*/5 * * * *</schedule>
  </job>
</group>

enter image description here

then I tried to fix it by setting up the cron to run every minute, but still got the same result

<group id="default"> 
  <job instance="Custom\Module\Cron\SyncTransaction" method="execute" name="lime_sepulsa_synctransaction">
    <schedule>* * * * *</schedule>
  </job>
</group>

enter image description here

2
  • First check cron log. Commented Nov 8, 2019 at 4:02
  • @DhadukMitesh no error in cron log
    – jojo
    Commented Nov 8, 2019 at 6:55

1 Answer 1

1

You should change your cronjob group id from default to index if you want your cron to run every minute without being missed:

<group id="index"> 
  <job instance="Custom\Module\Cron\SyncTransaction" method="execute" name="lime_sepulsa_synctransaction">
    <schedule>* * * * *</schedule>
  </job>
</group>

by default cronjob group with id default will run every 15 minutes but index group will run every minute

Your Answer

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

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