Вопрос

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

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top