fix: Account count function
All checks were successful
Build Docker / Build Main Image (push) Successful in 20s
All checks were successful
Build Docker / Build Main Image (push) Successful in 20s
This commit is contained in:
parent
2bf56fed8d
commit
19e2064a7a
11
db.py
11
db.py
@ -52,7 +52,6 @@ def get_link_count():
|
|||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
cursor.execute("SELECT COUNT(*) FROM links")
|
cursor.execute("SELECT COUNT(*) FROM links")
|
||||||
result = cursor.fetchone()
|
result = cursor.fetchone()
|
||||||
cursor.fetchall()
|
|
||||||
cursor.close()
|
cursor.close()
|
||||||
connection.close()
|
connection.close()
|
||||||
|
|
||||||
@ -70,14 +69,18 @@ def get_account_count():
|
|||||||
connection = mysql.connector.connect(**dbargs)
|
connection = mysql.connector.connect(**dbargs)
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
cursor.execute("SELECT * FROM links")
|
cursor.execute("SELECT * FROM links")
|
||||||
result = cursor.fetchone()
|
result = cursor.fetchall()
|
||||||
cursor.fetchall()
|
|
||||||
cursor.close()
|
cursor.close()
|
||||||
connection.close()
|
connection.close()
|
||||||
last_check_account = time.time()
|
last_check_account = time.time()
|
||||||
if result == None:
|
if result == None:
|
||||||
return 0
|
return 0
|
||||||
return 1
|
|
||||||
|
accounts = []
|
||||||
|
for link in result:
|
||||||
|
if link[1] not in accounts:
|
||||||
|
accounts.append(link[1])
|
||||||
|
return len(accounts)
|
||||||
|
|
||||||
def delete_token(token):
|
def delete_token(token):
|
||||||
connection = mysql.connector.connect(**dbargs)
|
connection = mysql.connector.connect(**dbargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user