-
Notifications
You must be signed in to change notification settings - Fork 204
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
Allow full clear of completed jobs #503
base: master
Are you sure you want to change the base?
Changes from 14 commits
5042af9
36a6f93
66daebf
843961f
5981be3
39d3551
60f7580
1793585
5d8a759
9bfd600
81c5305
f1b6c68
08252ea
80fb8f6
9f22820
95e5b48
2d31e13
fa17f7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ development.ini | |
node_modules | ||
*.project | ||
.eggs | ||
.vscode/ | ||
.vscode/ | ||
.idea/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,18 +216,15 @@ def clear_harvest_source_history(source_id, keep_current): | |
if source_id is not None: | ||
tk.get_action("harvest_source_job_history_clear")(context, { | ||
"id": source_id, | ||
"keep_current": keep_current | ||
}) | ||
}) | ||
return "Cleared job history of harvest source: {0}".format(source_id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note the language used in the return statement. This command is most useful if it clears the "job history", not the entire source history. Perhaps a change in the command name to "clear-job-history" would be better, as it more clearly states the eventual outcome of the command. |
||
else: | ||
# Purge queues, because we clean all harvest jobs and | ||
# objects in the database. | ||
if not keep_current: | ||
purge_queues() | ||
cleared_sources_dicts = tk.get_action( | ||
"harvest_sources_job_history_clear")(context, { | ||
"keep_current": keep_current | ||
}) | ||
"harvest_sources_job_history_clear")(context) | ||
return "Cleared job history for all harvest sources: {0} source(s)".format( | ||
len(cleared_sources_dicts)) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing table structure would require migration script, otherwise it would not be applied to any instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that a schema change creates some challenges for existing databases. However, the
ckanapi
package gives very nice support for exporting and re-importing users, packages, and organizations, so that a fresh database instance with imported users, etc is not very time consuming. I could write up a set of instructions for the Wiki if this is useful.