Removed unneeded function

This commit is contained in:
spla 2022-08-23 20:36:06 +02:00
pare 910d0a1d10
commit 4ad0ac3257

Veure arxiu

@ -499,36 +499,6 @@ class Peers:
print(f'{file_path} Missing parameter {parameter}')
sys.exit(0)
def write_server(server, federated_with):
insert_sql = "INSERT INTO world(server, federated_with, updated_at, saved_at, checked) VALUES(%s,%s,%s,%s,%s) ON CONFLICT DO NOTHING"
conn = None
try:
conn = psycopg2.connect(database = fediverse_db, user = fediverse_db_user, password = "", host = "/var/run/postgresql", port = "5432")
cur = conn.cursor()
cur.execute(insert_sql, (server, federated_with, now, now, 'f'))
print(f'writing {server} to world database')
conn.commit()
cur.close()
except (Exception, psycopg2.DatabaseError) as error:
print(error)
finally:
if conn is not None:
conn.close()
###############################################################################
# main