From 856ad1d9b7475d16f3b61da26a71ad0da0558ed5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 17 May 2023 19:47:57 +0200 Subject: [PATCH] Continued: - removed unused imports - set LIMIT 1 - improved a bit debug messages --- api.py | 2 -- fetch_instances.py | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/api.py b/api.py index 02de37d..8069c60 100644 --- a/api.py +++ b/api.py @@ -1,10 +1,8 @@ import uvicorn from fastapi import FastAPI, Request, HTTPException, responses, Query import sqlite3 -from hashlib import sha256 from fastapi.templating import Jinja2Templates from requests import get -from json import loads from datetime import datetime from email import utils import re diff --git a/fetch_instances.py b/fetch_instances.py index 346ece0..7b59280 100644 --- a/fetch_instances.py +++ b/fetch_instances.py @@ -24,13 +24,13 @@ for instance in peerlist: blacklisted = True if blacklisted: - print("domain is blacklisted:", domain) + print("DEBUG: domain is blacklisted:", domain) continue - print("Handling instance:", instance) + print("DEBUG: Handling instance:", instance) try: fba.c.execute( - "SELECT domain FROM instances WHERE domain = ?", (instance,) + "SELECT domain FROM instances WHERE domain = ? LIMIT 1", (instance,) ) if fba.c.fetchone() == None: -- 2.39.5