Don't try to backfill if limit is zero

This commit is contained in:
Tulir Asokan
2022-10-11 16:11:18 +03:00
parent 9b9a3b452d
commit 951d02bfc3
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -2646,6 +2646,8 @@ class Portal(DBPortal, BasePortal):
) -> str:
type = "initial" if initial else "sync"
limit = override_limit or self.config[f"bridge.backfill.forward.{type}_limit"]
if limit == 0:
return "Limit is zero, not backfilling"
with self.backfill_lock:
output = await self.backfill(
source, source.client, forward=True, forward_limit=limit, last_tgid=last_tgid