def update_data():
timenow = int(round(time.time(),0))
cursor_data = db_data.cursor()
for l in range(0,len(data_buffer)):
[pokeid, spawnid, latitude, longitude, expiretime, addinfo] = data_buffer.pop()
db_repeat = True
while db_repeat:
try:
cursor_data.execute("INSERT OR REPLACE INTO spawns VALUES(?,?,?,?,?,?,?,?)", [spawnid, round(latitude, 5), round(longitude, 5), addinfo, pokeid, expiretime, timenow, wID])
db_repeat = False
except sqlite3.OperationalError as e:
lprint('[-] Sqlite operational error: {} Retrying...'.format(e))
while True:
try:
db_data.commit()
return
except sqlite3.OperationalError as e:
lprint('[-] Sqlite operational error: {} Retrying...'.format(e))
评论列表
文章目录