-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add check if live_data exists, assuming live_data first type
- Loading branch information
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
b3e1d91
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.
@JoranAngevaare I tried this, but I was not really sure how to test it other than testing if the syntax in l.354 is doing what I want ;-)
Two comments:
main()
function, since I expect the troubles to arise here (all the runs are in principle auto processed, so if you want to process a single run, you might overdo it).There might be a smarter way/place to do it, but this was my first guess. Let me know what you think!
b3e1d91
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.
Right, very good! This is indeed where it should go (approximately).
If you look on
L348
, you can see thatrd = consider_run({'number': number})
is already going to change thebootstrax.status
so the change you made will be too late to catch that.So if you change this a bit (you don't need to look for data, and the live-data being the first unfortunately is often not true), to at line L347, you say
bootstrax_state = run_col.find_one({'number': number}, projection={'bootstrax': True}).get('bootstrax', {}).get{'state', 'no-state')
you can raise an errorif args.production and bootstrax_state in ['done', 'processing', 'considering']
. (I always make typos, but I think you get the idea)By the way, you don't want to push all of the logic under the
args.production
since we want to be able to test a single run (even if it processed already 😄 ).