Skip to content

Commit a84e523

Browse files
committed
Split out booleans for named server vs default server
1 parent 8aa9d94 commit a84e523

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

jupyterhub_idle_culler/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,15 @@ async def handle_server(user, server_name, server, max_age, inactive_limit):
236236
# return False
237237
# inactive_limit = server['state']['culltime']
238238

239+
is_default_server = server_name == ""
240+
is_named_server = server_name != ""
241+
239242
should_cull = (
240243
inactive is not None
241244
and inactive.total_seconds() >= inactive_limit
242245
and (
243-
(cull_default_servers and server_name == "")
244-
or (cull_named_servers and server_name)
246+
(cull_default_servers and is_default_server)
247+
or (cull_named_servers and is_named_server)
245248
)
246249
)
247250
if should_cull:

0 commit comments

Comments
 (0)