mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-01-01 23:44:21 +01:00
cap size of remote filter limits
I noticed the responses are a bit slow without this. Local query limits are not capped. Fixes: https://github.com/damus-io/notedeck/issues/98 Changelog-Changed: Restrict remote filter sizes to 250 (for now) Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -97,6 +97,12 @@ fn send_initial_filters(damus: &mut Damus, relay_url: &str) {
|
||||
let mut filter = timeline.filter.clone();
|
||||
for f in &mut filter {
|
||||
since_optimize_filter(f, timeline.notes(ViewFilter::NotesAndReplies));
|
||||
|
||||
// limit the size of remote filters
|
||||
let lim = f.limit.unwrap_or(100);
|
||||
if lim > 150 {
|
||||
f.limit = Some(150);
|
||||
}
|
||||
}
|
||||
relay.subscribe(format!("initial{}", c), filter);
|
||||
c += 1;
|
||||
|
||||
Reference in New Issue
Block a user