I tried using onOneServer to prevent multiple executions since our system uses auto-scaling. However, the cron job sometimes runs once, and other times it runs multiple times within a 1-microsecond difference. Here are the solutions I've tried, but nothing has worked:
1- I am trying to change the drivers from Redis & MySQL
2- decrease timeout from 30 to 10
3- using usleep for 5 milliseconds
console config:
'mutex' => [
'class' => 'yii\redis\Mutex'
],
cronjobs implementation:
$schedule->call(function(\yii\console\Application $app) {
\Yii::$app->sms->send("966**********", "One Server ".time());
})->everyMinute()->description("cron_every_minute")->onOneServer();
Hello All
I tried using onOneServer to prevent multiple executions since our system uses auto-scaling. However, the cron job sometimes runs once, and other times it runs multiple times within a 1-microsecond difference. Here are the solutions I've tried, but nothing has worked:
1- I am trying to change the drivers from Redis & MySQL 2- decrease timeout from 30 to 10 3- using usleep for 5 milliseconds
console config:
cronjobs implementation: