Skip to content

Commit

Permalink
no endless loop if queue too recent (#4349)
Browse files Browse the repository at this point in the history
  • Loading branch information
phiresky authored Jan 4, 2024
1 parent 4a740ee commit 0e6669f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/federate/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,15 @@ impl InstanceWorker {
self.save_and_send_state(pool).await?;
latest_id
};
if id == latest_id {
if id >= latest_id {
if id > latest_id {
tracing::error!(
"{}: last successful id {} is higher than latest id {} in database (did the db get cleared?)",
self.instance.domain,
id.0,
latest_id.0
);
}
// no more work to be done, wait before rechecking
tokio::select! {
() = sleep(*WORK_FINISHED_RECHECK_DELAY) => {},
Expand Down

0 comments on commit 0e6669f

Please sign in to comment.