完善功能:数据库超时等待
This commit is contained in:
14
main.py
14
main.py
@@ -1,4 +1,4 @@
|
||||
from Thread import UploadThread, FindThread, ByNetFindThread
|
||||
from Thread import UploadThread, FindThread, ByNetFindThread, MySQLConnectionPool
|
||||
from Tools import imagehash, Image, os, config
|
||||
|
||||
type = int(config['settings']['type'])
|
||||
@@ -12,8 +12,10 @@ if not os.path.exists('img'):
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
pool = MySQLConnectionPool()
|
||||
|
||||
if type == 1:
|
||||
Thread = FindThread(TargetImageHash)
|
||||
Thread = FindThread(TargetImageHash, pool)
|
||||
Thread.start()
|
||||
|
||||
elif type == 2:
|
||||
@@ -24,12 +26,6 @@ if __name__ == '__main__':
|
||||
|
||||
elif type == 3:
|
||||
while baseArr <= TargetRange[1]:
|
||||
Thread = UploadThread(baseArr)
|
||||
Thread.start()
|
||||
baseArr += 1
|
||||
Thread = UploadThread(baseArr)
|
||||
Thread.start()
|
||||
baseArr += 1
|
||||
Thread = UploadThread(baseArr)
|
||||
Thread = UploadThread(baseArr, pool)
|
||||
Thread.start()
|
||||
baseArr += 1
|
||||
|
||||
Reference in New Issue
Block a user