Skip to content

Commit

Permalink
Split out booleans for named server vs default server
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Jun 11, 2024
1 parent 8aa9d94 commit a84e523
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jupyterhub_idle_culler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,15 @@ async def handle_server(user, server_name, server, max_age, inactive_limit):
# return False
# inactive_limit = server['state']['culltime']

is_default_server = server_name == ""
is_named_server = server_name != ""

should_cull = (
inactive is not None
and inactive.total_seconds() >= inactive_limit
and (
(cull_default_servers and server_name == "")
or (cull_named_servers and server_name)
(cull_default_servers and is_default_server)
or (cull_named_servers and is_named_server)
)
)
if should_cull:
Expand Down

0 comments on commit a84e523

Please sign in to comment.