Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduler preventing other tasks from running. #146

Open
paishin opened this issue Mar 16, 2021 · 0 comments
Open

Scheduler preventing other tasks from running. #146

paishin opened this issue Mar 16, 2021 · 0 comments

Comments

@paishin
Copy link

paishin commented Mar 16, 2021

When I run schedule:run all scheduled jobs start executing one by one until indikator.news schedule command is executed which leaves the queue:work command running indefinitely preventing any following tasks from running.
I am not sure if this was caused because --daemon command is now deprecated but it prevents all other jobs from executing.

To get around the issue I have made the following change in Plugin.php but I am not sure if this is the appropriate way to fix it.

    public function registerSchedule($schedule)
    {
        $memory = (int)Config::get('indikator.news::memory_limit');
        $schedule->command('queue:work --daemon --queue=newsletter --memory=' . $memory)->everyMinute()->withoutOverlapping();
    }

to this

    public function registerSchedule($schedule)
    {
        $memory = (int)Config::get('indikator.news::memory_limit');
        $schedule->command('queue:work --once --queue=newsletter --memory=' . $memory)->everyMinute()->withoutOverlapping();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant