Skip to content

Commit cc8213d

Browse files
committed
executor as ApiHandle class attribute
1 parent d0e40d3 commit cc8213d

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)