Charrua
230
3
Laravel

Scheduler running strange

Posted 9 months ago by Charrua

Hello I have a really strange issue in scheduler, sometimes runs the same task for two or three times.. I don't really know what is happening, if there is a server issue or anything else...

This is my simple scheduler code:

<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [

    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        
        $schedule->call(function () {
            return true;
        })->everyMinute()->emailOutputTo('...')->thenPing('https://cronhub.io/ping/af709030-c0e8-11e8-9b2f-ff58704a871a');

    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }


}

The last outputs was:

And the issue is when running scheduler at a digital ocean server, if I run it locally no problems. Any ideas?

19.06
19.07
19.08
19.09
19.10
19.11
19.12
19.13

19.16
19.16
19.16

19.17
19.18

19.21
19.21
19.21

19.22
19.23

19.25
19.25

19.26

Please sign in or create an account to participate in this conversation.