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

Check if processed data already exists in --production mode #1024

Merged
merged 6 commits into from
May 16, 2022
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions bin/bootstrax
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,23 @@ def main():
elif args.process:
t_start = now()
number = args.process

# Check whether the run is already processed
bootstrax_state = run_coll.find_one(
{'number': number},
projection={'bootstrax': True}).get('bootstrax', {}
).get('state', 'no-state')
if args.production and bootstrax_state in ['done', 'busy', 'considering']:
message = f"It looks like run {number} is already processed."
log_warning(message, priority='fatal')
raise ValueError(message)

rd = consider_run({'number': number})
if rd is None:
message = f"Trying to process single run but no run numbered {number} exists"
log_warning(message, priority='fatal')
raise ValueError(message)

set_state('busy')
process_run(rd)
log.info(
Expand Down