修改BUG:选择正确的type后,再初始化Mysql连接池
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[settings]
|
||||
type = 3
|
||||
TargetRange = 1310371400, 1310379530
|
||||
TargetImage = ./img/target5.jpg
|
||||
type = 2
|
||||
TargetRange = 2787071343, 2787091343
|
||||
TargetImage = ./img/target4.jpg
|
||||
|
||||
[mysql]
|
||||
host = 192.168.9.1
|
||||
|
||||
4
main.py
4
main.py
@@ -12,9 +12,8 @@ if not os.path.exists('img'):
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
pool = MySQLConnectionPool()
|
||||
|
||||
if type == 1:
|
||||
pool = MySQLConnectionPool()
|
||||
Thread = FindThread(TargetImageHash, pool)
|
||||
Thread.start()
|
||||
|
||||
@@ -25,6 +24,7 @@ if __name__ == '__main__':
|
||||
baseArr += 1
|
||||
|
||||
elif type == 3:
|
||||
pool = MySQLConnectionPool()
|
||||
while baseArr <= TargetRange[1]:
|
||||
Thread = UploadThread(baseArr, pool)
|
||||
Thread.start()
|
||||
|
||||
Reference in New Issue
Block a user