From e66367516ac9474165cdf07ee56b8c02b8c72e6b Mon Sep 17 00:00:00 2001 From: Taeyang-Kim Date: Wed, 26 Feb 2025 22:57:19 +0900 Subject: [PATCH] =?UTF-8?q?from=20datetime=20import=20timezone=20=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spot-dataset/azure/lambda/current_collector/load_sps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/spot-dataset/azure/lambda/current_collector/load_sps.py b/collector/spot-dataset/azure/lambda/current_collector/load_sps.py index b73a62b..519688b 100644 --- a/collector/spot-dataset/azure/lambda/current_collector/load_sps.py +++ b/collector/spot-dataset/azure/lambda/current_collector/load_sps.py @@ -11,7 +11,7 @@ from sps_module import sps_prepare_parameters from json import JSONDecodeError from functools import wraps -from datetime import datetime, UTC +from datetime import datetime, timezone from utils.azure_auth import get_sps_token_and_subscriptions from utils.pub_service import S3, AZURE_CONST @@ -207,7 +207,7 @@ def execute_spot_placement_score_task_by_parameter_pool_df(api_calls_df, availab elif result == "NO_AVAILABLE_LOCATIONS": # NO_AVAILABLE_LOCATIONS인 경우 나머지 작업 취소 - current_utc_time = datetime.now(UTC).strftime("%Y_%m_%dT%H_%M_%S") + current_utc_time = datetime.now(timezone.utc).strftime("%Y_%m_%dT%H_%M_%S") S3.upload_file(SS_Resources.locations_call_history_tmp, f"{AZURE_CONST.ERROR_LOCATIONS_CALL_HISTORY_JSON_PATH}/{current_utc_time}.json", "json") print("No available locations found. Cancelling remaining tasks. ") for f in futures: