we can't change the db while running a query, so run the query first
diff --git a/plugins/background.py b/plugins/background.py
index c3b61ee..b54ad14 100644
--- a/plugins/background.py
+++ b/plugins/background.py
@@ -122,7 +122,8 @@
# Search forever, sleep a little in between
while True:
- for rule in config.sqlite.fetch("rules", limit=0):
+ all_rules = [item for item in config.sqlite.fetch("rules", limit=0)]
+ for rule in all_rules:
# print(f"Running rule #{rule['id']}: {rule['description']}...")
my_rule = BanRule(rule)
off = await my_rule.list_offenders(config)