def update_last_blocked(domain: str):
# NOISY-DEBUG: print("DEBUG: Updating last_blocked for domain", domain)
try:
- cursor.execute("UPDATE instances SET last_blocked = ?, last_updated = ? WHERE domain = ?", [
+ cursor.execute("UPDATE instances SET last_blocked = ?, last_updated = ? WHERE domain = ? LIMIT 1", [
time.time(),
time.time(),
domain
res = str(res)
if type(res) is str:
- cursor.execute("UPDATE instances SET last_status_code = 999, last_error_details = ?, last_updated = ? WHERE domain = ?", [
+ cursor.execute("UPDATE instances SET last_status_code = 999, last_error_details = ?, last_updated = ? WHERE domain = ? LIMIT 1", [
res,
time.time(),
domain
])
else:
- cursor.execute("UPDATE instances SET last_status_code = ?, last_error_details = ?, last_updated = ? WHERE domain = ?", [
+ cursor.execute("UPDATE instances SET last_status_code = ?, last_error_details = ?, last_updated = ? WHERE domain = ? LIMIT 1", [
res.status_code,
res.reason,
time.time(),
def update_last_nodeinfo(domain: str):
# NOISY-DEBUG: print("DEBUG: Updating last_nodeinfo for domain:", domain)
try:
- cursor.execute("UPDATE instances SET last_nodeinfo = ?, last_updated = ? WHERE domain = ?", [
+ cursor.execute("UPDATE instances SET last_nodeinfo = ?, last_updated = ? WHERE domain = ? LIMIT 1", [
time.time(),
time.time(),
domain
# NOISY-DEBUG: print("DEBUG: Looking up instance by domain:", blocked)
fba.cursor.execute(
- "SELECT domain FROM instances WHERE domain = ?", [blocked]
+ "SELECT domain FROM instances WHERE domain = ? LIMIT 1", [blocked]
)
if fba.cursor.fetchone() == None:
elif blocked.count("*") < 1:
# No obsfucation for this instance
fba.cursor.execute(
- "SELECT hash FROM instances WHERE domain = ?", [blocked]
+ "SELECT hash FROM instances WHERE domain = ? LIMIT 1", [blocked]
)
if fba.cursor.fetchone() == None:
# NOISY-DEBUG: print("DEBUG: AFTER-blocked:", blocked)
fba.cursor.execute(
- "SELECT domain FROM instances WHERE domain = ?", [blocked]
+ "SELECT domain FROM instances WHERE domain = ? LIMIT 1", [blocked]
)
if fba.cursor.fetchone() == None:
blocked = searchres[0]
fba.cursor.execute(
- "SELECT domain FROM instances WHERE domain = ?", [blocked]
+ "SELECT domain FROM instances WHERE domain = ? LIMIT 1", [blocked]
)
if fba.cursor.fetchone() == None: