Skip to content

Commit

Permalink
Merge pull request #7 from holahmeds/master
Browse files Browse the repository at this point in the history
Close resize pool thread when main thread finishes
  • Loading branch information
prprprus authored Dec 27, 2019
2 parents a1e6726 + 84f6c0b commit 212110a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pymysqlpool/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ def create_conn(self):

def _start(self):
"""Start thread for resize pool"""
t = Thread(target=resize_pool, args=(self.interval, self.stati_num,
self.multiple, self.counter,
self.accumulation, self))
t = Thread(target=resize_pool,
args=(self.interval, self.stati_num,
self.multiple, self.counter,
self.accumulation, self),
daemon=True)
t.start()

def _init_pool(self):
Expand Down

0 comments on commit 212110a

Please sign in to comment.