Use db_read_prefer_primary to get following list
@@ -47,7 +47,7 @@ pub fn following(req: &mut dyn RequestExt) -> EndpointResult {
use diesel::dsl::exists;
let user_id = req.authenticate()?.forbid_api_token_auth()?.user_id();
- let conn = req.db_read()?;
+ let conn = req.db_read_prefer_primary()?;
let follow = follow_target(req, &conn, user_id)?;
let following =
diesel::select(exists(follows::table.find(follow.id()))).get_result::<bool>(&*conn)?;
