Skip to content

Refactor Node Stats #1145

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Refactor Node Stats #1145

wants to merge 1 commit into from

Conversation

notAreYouScared
Copy link
Member

They've been problematic from day one... no need to make them a scheduled job

They have been problematic from day one... no need to make them a scheduled job
@notAreYouScared notAreYouScared self-assigned this Mar 21, 2025
@notAreYouScared notAreYouScared requested a review from a team as a code owner March 21, 2025 22:57
@lancepioch
Copy link
Member

I agree that it's not a great solution, but we can't poll every single second either, that's even worse.

@notAreYouScared
Copy link
Member Author

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.

@lancepioch
Copy link
Member

  1. Keep the Job class
  2. Refactor Job so it's one Node per Job
  3. Use the below middleware sample code to lock unique jobs
  4. 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()];
}

@Boy132 Boy132 marked this pull request as draft April 8, 2025 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants