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

Delay withChain Errors #34762

Closed
mikebrandl opened this issue Oct 8, 2020 · 6 comments
Closed

Delay withChain Errors #34762

mikebrandl opened this issue Oct 8, 2020 · 6 comments
Assignees
Labels

Comments

@mikebrandl
Copy link

  • Laravel Version: 8.9.0
  • PHP Version: 7.3.23
  • Database Driver & Version: Mysql

Description:

I have a delayed Queue Job, withChain, which I need to run two jobs shortly after each other.

QuoteJob::withChain([
new NestedQuoteJob($quote),
])->dispatch($quote)->delay(now()->addMinutes(1));

When using this I get the following error: message: "Call to a member function delay() on string"

This worked fine on Laravel 7 which is what I am attempting to upgrade from, so appears a new bug, non chained jobs work fine.

E.G QuoteJob::dispatch($quote)->delay(now()->addMinutes(1));

Steps To Reproduce:

Delay a dispatched, chained job.

@rodrigopedra
Copy link
Contributor

This feature was removed in this commit:

de662da

Included in this PR:

#33364

Unfortunately I couldn't find the reasoning on why this change was made. Maybe this could be reverted somehow.

@driesvints
Copy link
Member

Although the docs don't specifically show an example of using delay in combination with withChain I understand that this technically worked in a previous version. I'll check with @themsaid to see if we'll either add this to the upgrade guide or restore this functionality. Thanks for reporting.

@driesvints
Copy link
Member

@mikebrandl does it work if you put delay before dispatch?

@mikebrandl
Copy link
Author

Hi @driesvints Sadly not, just tried it.

@taylorotwell
Copy link
Member

Need more feedback from @themsaid on this but looks like the delay method needs to be added to PendingChain.

@taylorotwell
Copy link
Member

Fixed in next patch release.

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

No branches or pull requests

5 participants