shutdown the session async executor to cleanup useless threads
This commit is contained in:
parent
195b61fb57
commit
6709974d35
2 changed files with 8 additions and 0 deletions
|
|
@ -118,6 +118,9 @@ class Browser(object):
|
||||||
if isinstance(self.VERIFY, basestring):
|
if isinstance(self.VERIFY, basestring):
|
||||||
self.VERIFY = self.asset(self.VERIFY)
|
self.VERIFY = self.asset(self.VERIFY)
|
||||||
|
|
||||||
|
def deinit(self):
|
||||||
|
self.session.close()
|
||||||
|
|
||||||
def load_state(self, state):
|
def load_state(self, state):
|
||||||
if 'cookies' in state:
|
if 'cookies' in state:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -150,3 +150,8 @@ class FuturesSession(WeboobSession):
|
||||||
return self.executor.submit(func, *args, **kwargs)
|
return self.executor.submit(func, *args, **kwargs)
|
||||||
|
|
||||||
return sup(*args, **kwargs)
|
return sup(*args, **kwargs)
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
super(FuturesSession, self).close()
|
||||||
|
if self.executor:
|
||||||
|
self.executor.shutdown()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue