Skip to content

Commit a12495c

Browse files
committed
api bugs
1 parent d8d6ef7 commit a12495c

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

sds_data_manager/constructs/ialirt_api_manager_construct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(
6767

6868
auth_route_prefixes = ["", "/authorized", "/api-key"]
6969
if account_name == "prod":
70-
restricted_route_prefixes = ["/api-key"]
70+
restricted_route_prefixes = ["/api-key", "/authorized"]
7171
else:
7272
restricted_route_prefixes = auth_route_prefixes
7373

sds_data_manager/lambda_code/IAlirtCode/ialirt_realtime_query_api.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ def lambda_handler(event, context):
3737
)
3838

3939
now = datetime.now(timezone.utc)
40-
five_minutes_ago = now - timedelta(minutes=5)
40+
sixty_minutes_ago = now - timedelta(hours=1)
4141

4242
# Account for any cases in which data spans a threshold since
4343
# s3 only uses prefixes for queries.
4444
# Example:
4545
# now = 2026-01-01T00:02:00Z
46-
# five_minutes_ago = 2025-12-31T23:57:00Z
47-
first_prefix = five_minutes_ago.strftime("realtime/imap_ialirt_realtime_%Y-%jT%H")
46+
# sixty_minutes_ago = 2025-12-31T23:02:00Z
47+
first_prefix = sixty_minutes_ago.strftime("realtime/imap_ialirt_realtime_%Y-%jT%H")
4848
second_prefix = now.strftime("realtime/imap_ialirt_realtime_%Y-%jT%H")
4949

5050
first_response = s3_client.list_objects_v2(Bucket=bucket, Prefix=first_prefix)
@@ -59,9 +59,7 @@ def lambda_handler(event, context):
5959
return {
6060
"statusCode": 404,
6161
"headers": {"Content-Type": "application/json"},
62-
"body": json.dumps(
63-
{"error": "No realtime files found in the last 5 minutes."}
64-
),
62+
"body": json.dumps({"error": "No realtime files found in the last hour."}),
6563
}
6664

6765
# Pick the latest based on LastModified

0 commit comments

Comments
 (0)