Domanda

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

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top