修改BUG:程序无法停止

This commit is contained in:
Qiea
2024-12-22 20:36:29 +08:00
parent 383435dc1a
commit f73b40a979
3 changed files with 10 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
from time import sleep
from Thread import UploadThread, FindThread, ByNetFindThread, MySQLConnectionPool
from Tools import imagehash, Image, os, config
@@ -16,12 +17,16 @@ if __name__ == '__main__':
pool = MySQLConnectionPool()
Thread = FindThread(TargetImageHash, pool)
Thread.start()
os._exit(0)
elif type == 2:
while baseArr < TargetRange[1]:
while baseArr <= TargetRange[1]:
Thread = ByNetFindThread(TargetImageHash, baseArr)
Thread.start()
baseArr += 1
sleep(1)
os._exit(0)
elif type == 3:
pool = MySQLConnectionPool()
@@ -29,3 +34,4 @@ if __name__ == '__main__':
Thread = UploadThread(baseArr, pool)
Thread.start()
baseArr += 1
os._exit(0)