You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
The purpose of this proposal is to create an easier way to balance scheduled tasks between multiple servers.
We can only set up the schedule:run cronjob in only one server right now, if there are many big scheduled tasks in a project, the server load of cronjob server may become very high and slow down the tasks which may cause unexpected problems.
For current version of Laravel (5.4), we can create a job that implements ShouldQueue and create an artisan command that triggers the job to do what we want, but why not provide an easier way to do this?
For example, we make an artisan command class implements ShouldQueue, when schedule:run triggered, it finds that the scheduled task implements ShouldQueue, then it dispatches a built-in job called RunScheduledTaskJob.
Or add a method called queue to Illuminate\Console\Scheduling\Event class, so that we can define a scheduled task by
@tomschlick good idea, but sometimes we may need to run the scheduled task manually, so I think we still need a way to convert artisan command to queue job.
I'm going to look into this tonight to see how viable it is... I really like this as I have a few commands that only exist to throw jobs in the queue every X minutes.
The purpose of this proposal is to create an easier way to balance scheduled tasks between multiple servers.
We can only set up the
schedule:run
cronjob in only one server right now, if there are many big scheduled tasks in a project, the server load of cronjob server may become very high and slow down the tasks which may cause unexpected problems.For current version of Laravel (5.4), we can create a job that implements
ShouldQueue
and create an artisan command that triggers the job to do what we want, but why not provide an easier way to do this?For example, we make an artisan command class implements
ShouldQueue
, whenschedule:run
triggered, it finds that the scheduled task implementsShouldQueue
, then it dispatches a built-in job calledRunScheduledTaskJob
.Or add a method called
queue
toIlluminate\Console\Scheduling\Event
class, so that we can define a scheduled task byThe text was updated successfully, but these errors were encountered: