I am bad at SQL 💀💀💀
This commit is contained in:
parent
13d6846f5f
commit
94186bde4e
1 changed files with 5 additions and 2 deletions
|
@ -39606,6 +39606,7 @@ class ProducerStopIceNet(Plugin):
|
||||||
async def poll(self):
|
async def poll(self):
|
||||||
# Loop forever :3
|
# Loop forever :3
|
||||||
for i in range(1000000000000):
|
for i in range(1000000000000):
|
||||||
|
self.log.debug("Proc")
|
||||||
# Sleep for n seconds
|
# Sleep for n seconds
|
||||||
await asyncio.sleep(self.config["refresh_delay"])
|
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
|
# Filter by alert to ones with an ID not in the database
|
||||||
known_alerts_filtered = set()
|
known_alerts_filtered = set()
|
||||||
|
self.log.debug(known_alerts)
|
||||||
for alert_url in known_alerts:
|
for alert_url in known_alerts:
|
||||||
alert_id = url_to_id(alert_url)
|
alert_id = url_to_id(alert_url)
|
||||||
if "--" in alert_id or ";" in alert_id: continue # BF worried about injection
|
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
|
continue
|
||||||
else: known_alerts_filtered.add(alert_url)
|
else: known_alerts_filtered.add(alert_url)
|
||||||
|
self.log.debug(known_alerts_filtered)
|
||||||
for alert_url in known_alerts_filtered:
|
for alert_url in known_alerts_filtered:
|
||||||
# Get page
|
# Get page
|
||||||
alert_id = url_to_id(alert_url)
|
alert_id = url_to_id(alert_url)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue