]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 17 May 2023 17:47:57 +0000 (19:47 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 17 May 2023 17:47:57 +0000 (19:47 +0200)
- removed unused imports
- set LIMIT 1
- improved a bit debug messages

api.py
fetch_instances.py

diff --git a/api.py b/api.py
index 02de37d4a47f3ad76e8d0d4884b5da5b82f90ebf..8069c60584242c9dcf093e94f043496b5bbacb9e 100644 (file)
--- 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
index 346ece0c4a5a43d801f5c2f5743283b9d44532a0..7b592802365a282c5d47e095f2b9311ccc10f626 100644 (file)
@@ -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: