Skip to content

Commit a602f0b

Browse files
committed
added new input parameter and removed the date_utils call
1 parent 6e5c576 commit a602f0b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

source/workspaces_app/workspaces_app/utils/workspace_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import logging
77
import os
8-
from . import date_utils
98

109
TERMINATE_UNUSED_WORKSPACES = os.getenv('TerminateUnusedWorkspaces')
1110
RESOURCE_UNAVAILABLE = 'ResourceUnavailable'
@@ -21,7 +20,7 @@ def is_terminate_workspace_enabled():
2120
return TERMINATE_UNUSED_WORKSPACES == "Yes" or TERMINATE_UNUSED_WORKSPACES == "Dry Run"
2221

2322

24-
def check_if_workspace_used_for_selected_period(last_known_user_connection_timestamp):
23+
def check_if_workspace_used_for_selected_period(last_known_user_connection_timestamp, first_day_selected_month):
2524
"""
2625
This method returns a boolean value to indicate if the workspace was used in selected period
2726
:param: last_known_user_connection_timestamp: Last known connection timestamp
@@ -36,7 +35,6 @@ def check_if_workspace_used_for_selected_period(last_known_user_connection_times
3635
return True
3736
else:
3837
log.debug("Last know timestamp value is not None. Processing further.")
39-
first_day_selected_month = date_utils.get_first_day_selected_month()
4038
log.debug(f'First day for selected period is {first_day_selected_month}')
4139
last_known_user_connection_day = last_known_user_connection_timestamp.date()
4240
return last_known_user_connection_day >= first_day_selected_month

0 commit comments

Comments
 (0)