Merge pull request 'Fix #966: Don't retrieve user info from blocked instances' (#1120) from block-instance-user into main

Reviewed-on: https://git.joinplu.me/Plume/Plume/pulls/1120
This commit is contained in:
KitaitiMakoto 2023-01-04 16:11:34 +00:00
commit 4103e7513d

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);