Skip to content

Commit 7013e0a

Browse files
authored
Change periodic callback time from tuple to int (#376
Closes: #375
1 parent eb37a21 commit 7013e0a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

jupyterlab_server/handlers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def add_handlers(handlers, extension_app): # noqa
270270

271271
sys.exit(-1)
272272

273-
ListingsHandler.listings_refresh_seconds = settings_config.get( # type:ignore
273+
ListingsHandler.listings_refresh_seconds = settings_config.get(
274274
"listings_refresh_seconds", 60 * 60
275275
)
276276
ListingsHandler.listings_request_opts = settings_config.get("listings_request_options", {})
@@ -290,10 +290,10 @@ def add_handlers(handlers, extension_app): # noqa
290290
):
291291
from tornado import ioloop
292292

293-
callback_time = (ListingsHandler.listings_refresh_seconds * 1000,) # type:ignore
293+
callback_time = ListingsHandler.listings_refresh_seconds * 1000
294294
ListingsHandler.pc = ioloop.PeriodicCallback(
295295
lambda: fetch_listings(None), # type:ignore
296-
callback_time=callback_time, # type:ignore
296+
callback_time=callback_time,
297297
jitter=0.1,
298298
)
299299
ListingsHandler.pc.start() # type:ignore

jupyterlab_server/listings_handler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ class ListingsHandler(APIHandler):
7878
allowed_extensions: list = []
7979
# The provider request options to be used for the request library.
8080
listings_request_opts: dict = {}
81+
# The callback time for the periodic callback in seconds.
82+
listings_refresh_seconds: int
8183
# The PeriodicCallback that schedule the call to fetch_listings method.
8284
pc = None
8385

0 commit comments

Comments
 (0)