I am bad at SQL 💀💀💀

This commit is contained in:
Ben 2025-06-28 13:42:32 -07:00
parent 13d6846f5f
commit 94186bde4e
Signed by: webmaster
GPG key ID: A5FCBAF34E6E8B50

View file

@ -39606,6 +39606,7 @@ class ProducerStopIceNet(Plugin):
async def poll(self):
# Loop forever :3
for i in range(1000000000000):
self.log.debug("Proc")
# Sleep for n seconds
await asyncio.sleep(self.config["refresh_delay"])
@ -39626,13 +39627,15 @@ class ProducerStopIceNet(Plugin):
# Filter by alert to ones with an ID not in the database
known_alerts_filtered = set()
self.log.debug(known_alerts)
for alert_url in known_alerts:
alert_id = url_to_id(alert_url)
if "--" in alert_id or ";" in alert_id: continue # BF worried about injection
if await self.database.fetchrow("SELECT $1 FROM reports", alert_id):
if await self.database.fetchrow("SELECT id FROM reports where id=$1", alert_id):
self.log.debug("FOUND")
continue
else: known_alerts_filtered.add(alert_url)
self.log.debug(known_alerts_filtered)
for alert_url in known_alerts_filtered:
# Get page
alert_id = url_to_id(alert_url)