Refactor Node Stats
They've been problematic from day one... no need to make them a scheduled job
I agree that it's not a great solution, but we can't poll every single second either, that's even worse.
I agree that it's not a great solution, but we can't poll every single second either, that's even worse.
How is 1 second worse than a webhook doing it every second? This isn't a job that runs and only runs on page view.
- Keep the Job class
- Refactor Job so it's one Node per Job
- Use the below middleware sample code to lock unique jobs
- Keep the stats refreshing every 5 seconds but with the Job class
/**
* Get the middleware the job should pass through.
*
* @return array<int, object>
*/
public function middleware(): array
{
return [(new WithoutOverlapping($this->order->id))->dontRelease()];
}
I still feel we should poll when they're viewing the page.... What's the point of being able to view the last 30 or whatever seconds before you view the page?