新增内存监控
This commit is contained in:
10
main.py
10
main.py
@@ -1,7 +1,10 @@
|
||||
from Thread import UploadThread, FindThread, ByNetFindThread, MySQLConnectionPool
|
||||
from Tools import imagehash, Image, os, config
|
||||
from Tools import imagehash, Image, os, config, start_memory_monitor
|
||||
|
||||
Threads = []
|
||||
|
||||
if __name__ == '__main__':
|
||||
start_memory_monitor(500)
|
||||
|
||||
mytype = int(config['settings']['type'])
|
||||
TargetRange = list(map(int, config['settings']['TargetRange'].split(',')))
|
||||
@@ -25,6 +28,7 @@ if __name__ == '__main__':
|
||||
Thread = ByNetFindThread(TargetImageHash, baseArr)
|
||||
Thread.start()
|
||||
baseArr += 1
|
||||
Threads.append(Thread)
|
||||
|
||||
elif mytype == 3:
|
||||
pool = MySQLConnectionPool()
|
||||
@@ -32,3 +36,7 @@ if __name__ == '__main__':
|
||||
Thread = UploadThread(baseArr, pool)
|
||||
Thread.start()
|
||||
baseArr += 1
|
||||
Threads.append(Thread)
|
||||
|
||||
for Thread in Threads:
|
||||
Thread.join()
|
||||
Reference in New Issue
Block a user