新增内存监控

This commit is contained in:
Qiea
2025-01-28 19:03:58 +08:00
parent 9e4fae1faa
commit 9153f2210b
4 changed files with 44 additions and 6 deletions

10
main.py
View File

@@ -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()