Don't retrieve user info from blocked instances

This commit is contained in:
Kitaiti Makoto 2023-01-03 03:23:50 +09:00
parent 8c098def61
commit 2804a490ed

View file

@ -45,6 +45,9 @@ impl Actor for RemoteFetchActor {
RemoteUserFound(user) => match self.conn.get() {
Ok(conn) => {
let conn = DbConn(conn);
if user.get_instance(&conn).map_or(false, |instance| instance.blocked) {
return;
}
// Don't call these functions in parallel
// for the case database connections limit is too small
fetch_and_cache_articles(&user, &conn);