- removed unused imports
- set LIMIT 1
- improved a bit debug messages
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
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: