Skip to content

Commit ed3255e

Browse files
Nemo157jyn514
authored andcommitted
Hard error queueing new crates when there is no last seen reference
1 parent fa1862c commit ed3255e

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/build_queue.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -269,17 +269,9 @@ impl BuildQueue {
269269
let mut conn = self.db.get()?;
270270
let diff = index.diff()?;
271271

272-
let Some(last_seen_reference) = self.last_seen_reference()? else {
273-
// we should always have a last seen reference in the database, other than when
274-
// initialising a new deployment (e.g. dev/test/staging), in those cases we don't want
275-
// to rebuild the entire world, so we get crates-index-diff to fetch the current state
276-
// then use the current head as the base and will only start building new crates from
277-
// now on
278-
let (_, oid) = diff.peek_changes_ordered()?;
279-
warn!("no last_seen_reference in database, setting to current head {oid}");
280-
self.set_last_seen_reference(oid)?;
281-
return Ok(0);
282-
};
272+
let last_seen_reference = self
273+
.last_seen_reference()?
274+
.context("no last_seen_reference set in database")?;
283275
diff.set_last_seen_reference(last_seen_reference)?;
284276

285277
let (mut changes, new_reference) = diff.peek_changes_ordered()?;

0 commit comments

Comments
 (0)