no endless loop if queue too recent (#4349)

This commit is contained in:
phiresky 2024-01-04 19:28:26 +01:00 committed by GitHub
parent 4a740ee80a
commit 0e6669f617
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) => {},