I have a scheduled cron job that is set to run every day at 12:00am. The job runs correctly as per scheduled time, but the same job is again created at 12.01am. So technically the cron is run twice. The job is scheduled to send out emails every day, but each email is sent out twice and it's not a great experience. What should I do to stop the second job from getting created?
You could try to change your custom cron job group like in code below.
<group id="default"> <schedule_generate_every>15</schedule_generate_every> <schedule_ahead_for>20</schedule_ahead_for> <schedule_lifetime>15</schedule_lifetime> <history_cleanup_every>10</history_cleanup_every> <history_success_lifetime>60</history_success_lifetime> <history_failure_lifetime>600</history_failure_lifetime> <use_separate_process>0</use_separate_process> </group>
Or if you just got
crontab.xml, you should set the schedule like code below.
<schedule> 1439 * * *</schedule>
The time setting are in minute, not what hour the cron will start, then if you set the schedule 00 it will create double cron each it start.