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

Example of triggering jobs on cron schedule? #24

Open
connor11528 opened this issue Oct 14, 2021 · 1 comment
Open

Example of triggering jobs on cron schedule? #24

connor11528 opened this issue Oct 14, 2021 · 1 comment

Comments

@connor11528
Copy link
Contributor

Hi there, we have a schedule set to run a job on a regular basis but it doesn't seem this job is running. We've added this to the schedule function within app/Console/Kernel.php as outlined in the Laravel task scheduling docs.

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->call(function() {
            (new JobListingsSeeder)->run();
        })->weekly()->sundays()->at('18:00');
        Artisan::call('cache:clear');

        $schedule->command('populateCompanyRaiseRounds')->twiceDaily(1, 13);
    }

However it doesn't appear that these commands are running. I see that there are Render docs on cron jobs. I was wondering, how can we run Artisan commands on a schedule while hosted on Render?

@connor11528
Copy link
Contributor Author

I think in order to accomplish this we'll need Supervisor to continually boot up the queue:work and schedule:run commands. Doing that requires edits to the Dockerfile..

Docs: https://laravel.com/docs/9.x/queues#supervisor-configuration
Example with Apache: https://www.chrisgeiger.dev/posts/Running-Laravel-in-Docker-with-supervisord/
Example with Nginx: https://learn2torials.com/a/laravel8-production-docker-image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant