Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Scheduled tasks: Am I doing it wrong?#392

Unanswered
opicodes asked this question inQ&A
Feb 24, 2022· 2 comments· 3 replies
Discussion options

Hi,
I created a command and want to schedule it. I added the required method

    public function schedule(Schedule $schedule): void    {        $schedule->command(static::class)->everyMinute();    }

to the command itself.

I then installed the schedule-list component, but running theschedule:list command always returnsNo tasks scheduled.

I suppose there is some magic that somehow check which commands exist and schedule them when they have that method?

You must be logged in to vote

Replies: 2 comments 3 replies

Comment options

I think this is maybe a bug, as they should show up in theschedule:list command. As far as I know that's because ofthis code where it runs theschedule() command when Artisan boots. Rather than adding them to the list of events which would then be shown inthis code.

Just to confirm, your command is extendingLaravelZero\Framework\Commands\Command rather thanIlluminate\Console\Command? 👍🏻

You must be logged in to vote
3 replies
@opicodes
Comment options

Thanks very much, you are a life saver, I didn't notice the different parent. I guess it should made more prominent in the docs either in the command section or in the Schedule Tasks one (being a requirement for this).

@owenvoke
Comment options

No problem. 👍🏻 Yeah, I'll update the docs later. Or feel free to if you'd like. 👍🏻

@opicodes
Comment options

Another thing that seems to be missing is the schedule commandschedule:work to mimic the cron for development as describedhere

Comment options

Im having the same issue, scheduler doesnt appear to work. Someone has suggested a PR fix:laravel-zero/framework#462

But it doesnt seem like this project has much maintainers or is delaying merging PRs as there are some dated from January still open. :/

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
3 participants
@opicodes@owenvoke@surgiie

[8]ページ先頭

©2009-2025 Movatter.jp