Skip to content

Commit

Permalink
server: misc
Browse files Browse the repository at this point in the history
  • Loading branch information
pnmadelaine committed Oct 23, 2023
1 parent 7b345cc commit fdea675
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions typhon/src/jobsets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ impl Jobset {
.filter(schema::evaluations::url.eq(&url))
.first::<models::Evaluation>(conn)
.optional()?;
let max = schema::evaluations::table
.filter(schema::evaluations::jobset_id.eq(self.jobset.id))
.select(diesel::dsl::max(schema::evaluations::num))
.first::<Option<i64>>(conn)?
.unwrap_or(0);

// continue if the evaluation is forced
if let Some(eval) = preexisting_eval {
Expand All @@ -75,6 +70,11 @@ impl Jobset {
}

// create a new evaluation
let max = schema::evaluations::table
.filter(schema::evaluations::jobset_id.eq(self.jobset.id))
.select(diesel::dsl::max(schema::evaluations::num))
.first::<Option<i64>>(conn)?
.unwrap_or(0);
let num = max + 1;
let status = "pending".to_string();
let time_created = crate::time::now();
Expand Down

0 comments on commit fdea675

Please sign in to comment.