Skip to content

Commit 84f6c0b

Browse files
holahmedsenosis-ahmedrafiq
authored andcommitted
Close resize pool thread when main thread finishes
1 parent aa5ec72 commit 84f6c0b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pymysqlpool/pool.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,11 @@ def create_conn(self):
120120

121121
def _start(self):
122122
"""Start thread for resize pool"""
123-
t = Thread(target=resize_pool, args=(self.interval, self.stati_num,
124-
self.multiple, self.counter,
125-
self.accumulation, self))
123+
t = Thread(target=resize_pool,
124+
args=(self.interval, self.stati_num,
125+
self.multiple, self.counter,
126+
self.accumulation, self),
127+
daemon=True)
126128
t.start()
127129

128130
def _init_pool(self):

0 commit comments

Comments
 (0)