优化代码
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import pymysql, threading, time
|
||||
from queue import Queue
|
||||
|
||||
import requests
|
||||
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from Tools import config, Hash, Image, imagehash, os, logging, download_image, remove_image, clean_image, compare
|
||||
|
||||
@@ -27,7 +24,7 @@ class MySQLConnectionPool:
|
||||
)
|
||||
self.pool.put(conn)
|
||||
|
||||
def get_connection(self, max_retries=5, wait_time=1):
|
||||
def get_connection(self, max_retries=65535, wait_time=3):
|
||||
"""获取一个数据库连接,如果连接池为空,继续尝试直到能够获取连接"""
|
||||
retries = 0
|
||||
while retries < max_retries:
|
||||
|
||||
Reference in New Issue
Block a user