mirror of
https://github.com/FoggedLens/deflock.git
synced 2026-02-12 15:02:45 +00:00
use slash as delimiter to match url scheme, drop Lambda memory
This commit is contained in:
@@ -98,7 +98,7 @@ def segment_regions(nodes: Any, tile_size_degrees: int) -> dict[Any]:
|
||||
lat, lon = node["lat"], node["lon"]
|
||||
tile_lat = int(np.floor(lat / tile_size_degrees)) * tile_size_degrees
|
||||
tile_lon = int(np.floor(lon / tile_size_degrees)) * tile_size_degrees
|
||||
tile_dict[f"{tile_lat},{tile_lon}"].append(node)
|
||||
tile_dict[f"{tile_lat}/{tile_lon}"].append(node)
|
||||
print("Region segmentation complete.")
|
||||
|
||||
return tile_dict
|
||||
@@ -145,7 +145,7 @@ def lambda_handler(event, context):
|
||||
with ThreadPoolExecutor(max_workers=10) as executor:
|
||||
futures = []
|
||||
for latlng_string, elements in regions_dict.items():
|
||||
lat, lon = latlng_string.split(",")
|
||||
lat, lon = latlng_string.split("/")
|
||||
key = f"regions/{lat}/{lon}.json"
|
||||
body = json.dumps(elements)
|
||||
futures.append(executor.submit(upload_json_to_s3, bucket_new, key, body))
|
||||
|
||||
@@ -53,7 +53,7 @@ resource "aws_lambda_function" "overpass_lambda" {
|
||||
package_type = "Image"
|
||||
image_uri = "${aws_ecr_repository.lambda_repository.repository_url}:latest"
|
||||
timeout = 180
|
||||
memory_size = 1024
|
||||
memory_size = 512
|
||||
environment {
|
||||
variables = {
|
||||
UPDATE_RATE_MINS = var.rate
|
||||
|
||||
Reference in New Issue
Block a user