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

Improve handling of jobs #10886

Open
jonasraoni opened this issue Feb 5, 2025 · 0 comments
Open

Improve handling of jobs #10886

jonasraoni opened this issue Feb 5, 2025 · 0 comments
Labels
Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day.

Comments

@jonasraoni
Copy link
Contributor

Extracted from #9822

  • Ensure jobs can be terminated gracefully (store the progress somewhere), and be careful with things that shouldn't be executed twice (e.g. sending an email)
  • The BaseJob have some default values (default timeout of 60s, backoff of 5s, etc), I think it's better to make it required instead of providing random default values. Forcing the programmer to fill in these values, it's also a good reminder to treat the exceptional cases.
  • It's difficult to estimate how long some jobs might run (e.g. a large installation might require much more time). So, I think the timeout should be removed (or have a really high value), if it's not possible to update the code to terminate gracefully (i.e. resume the work from where it stopped later).
  • Looks like the Laravel doesn't have a isTimedOut() method, we could add it and update the code to respect it (e.g. while (!$this->isTimedOut()) { doWork(); }) instead of using the $failOnTimeout = true, it sounds better for most of the cases. IMHO abruptly timeouts are good only to catch bad code (e.g. infinite loops)...
@jonasraoni jonasraoni added the Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day. label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day.
Projects
None yet
Development

No branches or pull requests

1 participant