feat: [#534] add schedule:run and schedule:list commands#1019
feat: [#534] add schedule:run and schedule:list commands#1019
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request implements two new Artisan commands for managing scheduled tasks in Goravel. The changes include command registration in the service provider, implementation of the schedule:run command and schedule:list command with corresponding tests, and required updates to the schedule interface and mocks.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| schedule/service_provider.go | Registers the new schedule:list and schedule:run commands. |
| schedule/console/run_command.go | Implements the schedule:run command to trigger the scheduler. |
| schedule/console/list_command.go | Implements the schedule:list command to display scheduled tasks. |
| schedule/console/list_command_test.go | Adds tests to verify output for the list command. |
| schedule/application.go | Updates the application to manage schedule events. |
| mocks/schedule/Schedule.go | Updates the mocks to provide the new Events method. |
| contracts/schedule/schedule.go | Updates the schedule interface with the Events method. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1019 +/- ##
==========================================
+ Coverage 70.97% 71.16% +0.18%
==========================================
Files 170 172 +2
Lines 11705 11807 +102
==========================================
+ Hits 8308 8402 +94
- Misses 3044 3052 +8
Partials 353 353 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
eca73dd to
a95ec46
Compare
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: 1c21aa6 | Previous: 35ac966 | Ratio |
|---|---|---|---|
BenchmarkFile_ReadWrite |
305268 ns/op 2072 B/op 28 allocs/op |
184622 ns/op 2072 B/op 28 allocs/op |
1.65 |
BenchmarkFile_ReadWrite - ns/op |
305268 ns/op |
184622 ns/op |
1.65 |
This comment was automatically generated by workflow using github-action-benchmark.
|
Sorry for the delay, I‘ve been moving house recently. |


📑 Description
Closes goravel/goravel#534
This PR adds two new Artisan commands:
schedule:run: Starts the internal scheduler and runs all due tasks.
schedule:list: Lists all registered scheduled tasks.
Goravel has a built-in task scheduling system based on robfig/cron, a robust and flexible cron engine for Go.
Thanks to this internal scheduler, there is no need to rely on the system’s crontab to trigger scheduled tasks. We can manage task execution entirely within the application by keeping the schedule:run process alive.
We only need to:
Run artisan schedule:run as the main process in a Docker container, or
Use a process manager like supervisord, systemd, or pm2 to ensure the schedule:run process remains running.
This approach provides a reliable, container-friendly, and framework-native solution for task scheduling in Goravel applications.
✅ Checks