修改BUG:程序无法停止
This commit is contained in:
8
main.py
8
main.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user