diff --git a/lambda/encise-data-unreceive-check/encise-data-unreceive-check.py b/lambda/encise-data-unreceive-check/encise-data-unreceive-check.py index d762c275..389c82f9 100644 --- a/lambda/encise-data-unreceive-check/encise-data-unreceive-check.py +++ b/lambda/encise-data-unreceive-check/encise-data-unreceive-check.py @@ -223,8 +223,9 @@ def encise_data_unreceive_check(records: list, execute_month: str) -> tuple[list is_file_not_exists = False # 存在したファイルの年月部分を抜き出し、チェック対象年月(処理稼働月-1)である場合 match_group_yyyymm = match_result.group(1) - check_target_yyyymm = (datetime.datetime.now( - ZoneInfo(TZ)) - relativedelta(month=1)).strftime('%Y%m') + today = datetime.datetime.now(ZoneInfo(TZ)) + minus_1_month = today + relativedelta(months=-1) + check_target_yyyymm = minus_1_month.strftime('%Y%m') if match_group_yyyymm == check_target_yyyymm: logger.info( f'I-04-04 I/Fファイルの受領を確認しました ファイル名:{file_name}')