- be kind! set recheck_instance to at least 3600 seconds (one hour)
"bot_instance": "https://example.com",
"bot_token": "",
"bot_visibility": "unlisted",
"bot_instance": "https://example.com",
"bot_token": "",
"bot_visibility": "unlisted",
- "slogan": "### Your footer slogan ###"
+ "slogan": "### Your footer slogan ###",
+ "recheck_instance": 3600
print("--- Adding new instance:", domain)
try:
c.execute(
print("--- Adding new instance:", domain)
try:
c.execute(
- "INSERT INTO instances SELECT ?, ?, ?, ?",
+ "INSERT INTO instances SELECT ?, ?, ?, NULL",
(
domain,
get_hash(domain),
(
domain,
get_hash(domain),
- determine_software(domain),
- time.time()
+ determine_software(domain)
import sqlite3
import sys
import json
import sqlite3
import sys
import json
import fba
def fetch_instances(domain: str):
import fba
def fetch_instances(domain: str):
# Loop through some instances
fba.c.execute(
# Loop through some instances
fba.c.execute(
- "SELECT domain FROM instances WHERE software IS NOT NULL ORDER BY rowid DESC"
+ "SELECT domain FROM instances WHERE software IS NOT NULL AND (last_access IS NULL OR last_access < ?) ORDER BY rowid DESC", [time.time() - fba.config["recheck_instance"]]
)
for instance in fba.c.fetchall():
)
for instance in fba.c.fetchall():