itsgoingd / itsgoingd/clockwork
On Demand not working with Laravel Octane
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 6k
- Forks
- 333
- Avg merge
- 5m
- Merged PRs (30d)
- 1
Description
When running with a configured on demand key no requests are captured.
My investigation shows that this is caused because the service provider is only booted on startup of Octane and the event listeners and middleware are not registered.
https://github.com/itsgoingd/clockwork/blob/bd13e765a6d77d95a6d6ecf9842a7d02382ff39d/Clockwork/Support/Laravel/ClockworkServiceProvider.php#L27-L30
Line 27 will evaluate to false.
Analysis
When the Octane server boots up and registers the service providers and a new empty request is created in the support class.
This empty request does not contain the on demand key and thus will fail the shouldCollect() call on Line 54
The end result is that the middleware and event listeners are not registered.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Clockwork/Support/Laravel/ClockworkServiceProvider.php around lines 27-30 and trace how Octane startup reaches Clockwork/Support/Laravel/ClockworkSupport.php around lines 549-555 and 661-672. Reproduce the configured on-demand-key case under Laravel Octane and verify that middleware and event listeners are registered and requests are captured when the key is present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- backend, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100