-
-
Notifications
You must be signed in to change notification settings - Fork 880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit tests and cleanup for outgoing federation code #4733
Conversation
tracing::warn!("task exited, restarting: {res:?}"); | ||
} | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop here seems completely unnecessary as the send worker is already looping on its own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the instance worker loop actually reliably looped it would have a return type of ! or (), but it returns a result. the reason this restart is necessary is that on internal errors, the function exits and the worker needs to be restarted
@@ -94,11 +94,15 @@ impl Instance { | |||
.await | |||
} | |||
|
|||
#[cfg(test)] | |||
/// Only for use in tests | |||
pub async fn delete_all(pool: &mut DbPool<'_>) -> Result<usize, Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to remove this because items marked as #[cfg(test)]
are only available within the same crate.
} | ||
} | ||
info!("{ok_count} others up to date. {behind_count} instances behind."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this stuff into separate file without changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not my area of expertise, so it might be good for @phiresky to take a look.
for (instance_id, stat) in stats { | ||
let domain = &instances | ||
.iter() | ||
.find(|i| &i.id == instance_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a pretty unnecessary O(n^2) that was added, this looped through ~5k things before, now it loops through 25 million things every time.
No description provided.