Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Commit 6f6350f

Browse files
committed
修复偶现bug
1 parent 8945184 commit 6f6350f

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

IP_Sync/convert.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@ def convert_ip(sql_object, college_tablename, num_config, start_id, correct_list
6363

6464
if result_num == num_config:
6565
print( "本批次(行:" + str(start_id-1) + " - " + str( next_id - 2 ) + ")已处理完成。共需处理" + str(result_num) + "条,成功转换" + str(i) + "条。\n系统将自动处理下一批IP数据(行:" + str(next_id-1) + " - " + str(next_end_id-1) + ")…… \n---------------处理中, 请稍候---------------" )
66-
sql_object.__del__()
67-
if sqlite3file:
68-
sql_object = sqlite3_Database(sqlite3file)
69-
else:
70-
sql_object = mysql_Database(config['mysql'].ip_database)
66+
# try:
67+
# sql_object.__del__()
68+
# finally:
69+
# pass
70+
# if sqlite3file:
71+
# sql_object = sqlite3_Database(sqlite3file)
72+
# else:
73+
# sql_object = mysql_Database(config['mysql'].ip_database)
7174
convert_ip(sql_object, college_tablename, num_config, next_id, correct_list, correct_json,sqlite3file=sqlite3file)
7275
else:
7376
print( "本批次(行:" + str(start_id-1) + " - " + str( start_id + result_num -2 ) + ")已处理完成。共需处理" + str(result_num) + "条,成功转换" + str(i) + "条。" )

IP_Sync/ip_Sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def sqldump(sql_file,table_college_info_sql_file,table_iprange_info_sql_file,tab
268268
def sqlite3dump(sqlite3file):
269269
print( "将SQLite3数据库压缩为gz文件: \n---------------处理中, 请稍候---------------")
270270
if default_gz_export:
271-
os.system('gzip -y %s' % ( sqlite3file))
271+
os.system('gzip -fq %s' % ( sqlite3file))
272272
print( "SQLite3数据库gz压缩档导出成功! \n")
273273

274274
if __name__ == '__main__':

0 commit comments

Comments
 (0)