Skip to content

Commit 990cee3

Browse files
committed
included the FUNCTION_URL_REFRESH_MV environment variable in the reverse_geolocation_processor function configuration, enabling direct HTTP calls to the refresh_materialized_view function
1 parent 124b62c commit 990cee3

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

functions-python/refresh_materialized_view/src/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import functions_framework
66
from google.protobuf import timestamp_pb2
77

8-
from shared.helpers import timezone
98
from shared.helpers.logger import init_logger
109
from shared.database.database import with_db_session
1110

functions-python/reverse_geolocation/src/reverse_geolocation_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def extract_location_aggregates(
382382
if not function_url:
383383
raise ValueError("FUNCTION_URL_REFRESH_MV environment variable is not set")
384384

385-
response = requests.get(f"{function_url}/refresh-materialized-view")
385+
response = requests.get(f"{function_url}")
386386
response.raise_for_status()
387387
logger.info("Materialized view refresh event triggered successfully.")
388388

infra/functions-python/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,7 @@ resource "google_cloudfunctions2_function" "reverse_geolocation_processor" {
10081008
PYTHONNODEBUGRANGES = 0
10091009
DATASETS_BUCKET_NAME_GTFS = "${var.datasets_bucket_name}-${var.environment}"
10101010
DATASETS_BUCKET_NAME_GBFS = "${var.gbfs_bucket_name}-${var.environment}"
1011+
FUNCTION_URL_REFRESH_MV = "https://${var.gcp_region}-${var.project_id}.cloudfunctions.net/refresh_materialized_view"
10111012
}
10121013
available_memory = local.function_reverse_geolocation_config.available_memory
10131014
timeout_seconds = 3600

0 commit comments

Comments
 (0)