foxdevuz's avatar

Schedule is working to slow

I was using custom cronjob (with while true) to make my app work properly and I decided to change it to laravel schedule and I did it, here's the console.php:

<?php

use App\Http\Controllers\ShareTestController;

Schedule::call(function () {
    $test = new ShareTestController();
    $test->timeUpGroup();
})->everySecond();

Schedule::call(function () {
    $test = new ShareTestController();
    $test->timeUp();
})->everySecond();

and ShareTestController

the problem is, when I do it with custom cronejob it was fst enought but now it's very slow and I don't know what to do.

how can I make it as fast as it was?

0 likes
1 reply
Snapey's avatar

why do you need so much complexity every second? Consider how to simplify this. Remember, to run this every second, your code must take less than a second to run, or you will end up more and more jobs running

Please or to participate in this conversation.