-
Notifications
You must be signed in to change notification settings - Fork 72
Crashed worker to update job itself (and make the UI clearer on status) #602
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e4ae314
create test datasource
dale-wahl a44cfc0
update job.py to allow for "parking" crashed jobs for a restart
dale-wahl a78f3ca
update worker.py to officially mark crashed jobs.
dale-wahl b6eef6e
note in queue.py on new Job.STATUS_PARKED
dale-wahl a3fd241
update test datasource to let me have more than one running
dale-wahl 03b8eab
update api.py to use and pass parked/crashed jobs; show on Active Wor…
dale-wahl add712b
Update jobs.html and allow retrying crashed jobs (without restart!)
dale-wahl af877ac
fix attempt counting bug i introduced
dale-wahl a7bc04c
Merge branch 'master' into pr/602
dale-wahl 926f407
skip no import warning if datasource_disabled
dale-wahl 9da6df8
park reoccurring jobs as well on crash
dale-wahl fe12829
update test datasource for intervals (and note datasources cannot be …
dale-wahl b5938d8
word-trees: ruff says remove unused assignment
dale-wahl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| """ | ||
| Test datasource (development only) | ||
|
|
||
| Provides a dummy "search" worker that creates datasets in deliberately distinct | ||
| states (completing normally, running forever, or crashing) so the worker-status | ||
| and queue admin pages can be exercised without running a real data collection. | ||
|
|
||
| The search worker only registers itself when the | ||
| ``FOURCAT_ENABLE_TEST_DATASOURCE`` environment variable is set to a truthy | ||
| value, so this datasource is inert (no worker, nothing runnable) on a normal or | ||
| production instance even though the folder is present. | ||
|
|
||
| See ``helper-scripts/create_test_jobs.py`` for enqueuing one of each state. | ||
| """ | ||
| import os | ||
|
|
||
| # only register this datasource when explicitly enabled, so it is inert on a | ||
| # normal/production instance. This MUST match the gate on the search worker in | ||
| # search_test.py: if the datasource registers without its worker, | ||
| # manager.validate_datasources() errors with "No search worker defined". | ||
| if os.environ.get("FOURCAT_ENABLE_TEST_DATASOURCE", "").lower() in ("1", "true", "yes", "on"): | ||
| # Use default data source init function | ||
| from common.lib.helpers import init_datasource as init_datasource | ||
|
|
||
| # Internal identifier for this data source | ||
| DATASOURCE = "test" | ||
| NAME = "Test datasource (dev only)" | ||
| else: | ||
| # deliberately inert on a normal/production instance; tell the loader | ||
| # this is intentional so it doesn't warn about missing attributes | ||
| DATASOURCE_DISABLED = True |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.