Skip to content

Commit 212110a

Browse files
authored
Merge pull request #7 from holahmeds/master
Close resize pool thread when main thread finishes
2 parents a1e6726 + 84f6c0b commit 212110a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pymysqlpool/pool.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ def create_conn(self):
127127

128128
def _start(self):
129129
"""Start thread for resize pool"""
130-
t = Thread(target=resize_pool, args=(self.interval, self.stati_num,
131-
self.multiple, self.counter,
132-
self.accumulation, self))
130+
t = Thread(target=resize_pool,
131+
args=(self.interval, self.stati_num,
132+
self.multiple, self.counter,
133+
self.accumulation, self),
134+
daemon=True)
133135
t.start()
134136

135137
def _init_pool(self):

0 commit comments

Comments
 (0)