-
This commit is contained in:
parent
ee19803704
commit
af3a946d20
2
app.py
2
app.py
@ -38,9 +38,7 @@ class PingThread(threading.Thread):
|
|||||||
def check_allocation_thread_function():
|
def check_allocation_thread_function():
|
||||||
while True:
|
while True:
|
||||||
ids = db.get_image_allocation_all()
|
ids = db.get_image_allocation_all()
|
||||||
print(ids)
|
|
||||||
for x in ids:
|
for x in ids:
|
||||||
print(x[0])
|
|
||||||
ip = db.get_image_allocation_clientip_id(x[0])
|
ip = db.get_image_allocation_clientip_id(x[0])
|
||||||
ping_thread = PingThread(ip, x[0])
|
ping_thread = PingThread(ip, x[0])
|
||||||
ping_thread.start()
|
ping_thread.start()
|
||||||
|
2
db.py
2
db.py
@ -150,7 +150,7 @@ def get_image_allocation_all():
|
|||||||
connect()
|
connect()
|
||||||
with get_cur() as cur:
|
with get_cur() as cur:
|
||||||
cur.execute("""
|
cur.execute("""
|
||||||
SELECT image_id FROM image_allocation""")
|
SELECT id FROM image_allocation""")
|
||||||
try:
|
try:
|
||||||
results = [list(row) for row in cur.fetchall()]
|
results = [list(row) for row in cur.fetchall()]
|
||||||
return results
|
return results
|
||||||
|
Loading…
Reference in New Issue
Block a user