Skip to content

Commit a72f1da

Browse files
authored
Merge pull request #95 from jtpio/executor
`executor` as ApiHandle class attribute
2 parents d0e40d3 + cc8213d commit a72f1da

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

jupyter_resource_usage/api.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@
1414

1515

1616
class ApiHandler(APIHandler):
17-
def initialize(self):
18-
self.executor = ThreadPoolExecutor(max_workers=5)
19-
20-
def __del__(self):
21-
# Ensure the executor is properly shutdown
22-
self.executor.shutdown(wait=False)
23-
super().__del__()
17+
executor = ThreadPoolExecutor(max_workers=5)
2418

2519
@web.authenticated
2620
async def get(self):

0 commit comments

Comments
 (0)