fix
This commit is contained in:
parent
f4e131b842
commit
57edc02ba9
@ -276,6 +276,7 @@ def merge_db(db_paths, save_path="merge.db", CreateTime: int = 0, endCreateTime:
|
|||||||
sql = f"INSERT OR IGNORE INTO {table} ({','.join([i[0] for i in col_type])}) VALUES ({','.join(['?'] * len(columns))})"
|
sql = f"INSERT OR IGNORE INTO {table} ({','.join([i[0] for i in col_type])}) VALUES ({','.join(['?'] * len(columns))})"
|
||||||
out_cursor.executemany(sql, src_data)
|
out_cursor.executemany(sql, src_data)
|
||||||
outdb.commit()
|
outdb.commit()
|
||||||
|
db.close()
|
||||||
outdb.close()
|
outdb.close()
|
||||||
return save_path
|
return save_path
|
||||||
|
|
||||||
@ -373,7 +374,10 @@ def merge_real_time_db(key, db_path: str, merge_path: str, CreateTime: int = 0,
|
|||||||
raise FileNotFoundError("合并失败")
|
raise FileNotFoundError("合并失败")
|
||||||
|
|
||||||
a = merge_db([out_path], merge_path, CreateTime=CreateTime, endCreateTime=endCreateTime)
|
a = merge_db([out_path], merge_path, CreateTime=CreateTime, endCreateTime=endCreateTime)
|
||||||
|
try:
|
||||||
os.remove(out_path)
|
os.remove(out_path)
|
||||||
|
except:
|
||||||
|
time.sleep(3)
|
||||||
|
os.remove(out_path)
|
||||||
|
|
||||||
return merge_path
|
return merge_path
|
||||||
|
Loading…
Reference in New Issue
Block a user