Skip to content

Commit

Permalink
Small conceptual simplification in new_run().
Browse files Browse the repository at this point in the history
  • Loading branch information
vdbergh committed Oct 28, 2024
1 parent 12981ff commit b31a5aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions server/fishtest/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ def new_run(
if tc_base:
tc_base = float(tc_base.group(1))
new_run = {
"_id": ObjectId(),
"version": RUN_VERSION,
"args": run_args,
"start_time": start_time,
Expand Down Expand Up @@ -566,9 +567,9 @@ def new_run(
print(message, flush=True)
raise Exception(message)

# We cannot use self.buffer since new_run does not have an id yet.
run_id = str(self.runs.insert_one(new_run).inserted_id)
self.buffer(new_run, True)

run_id = new_run["_id"]
with self.unfinished_runs_lock:
self.unfinished_runs.add(run_id)

Expand Down
4 changes: 2 additions & 2 deletions server/fishtest/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,11 +640,11 @@ def flags_must_match(run):
# about non-validation of runs created with the prior
# schema.

RUN_VERSION = 4
RUN_VERSION = 5

runs_schema = intersect(
{
"_id?": ObjectId,
"_id": ObjectId,
"version": uint,
"start_time": datetime_utc,
"last_updated": datetime_utc,
Expand Down

0 comments on commit b31a5aa

Please sign in to comment.