mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2025-04-07 19:14:15 +00:00
DFM fixes
This commit is contained in:
parent
d782a9ad2e
commit
451f6cb2b0
@ -101,6 +101,12 @@ async def upload(event, context):
|
||||
event["time_server"] = datetime.datetime.now().isoformat()
|
||||
payload["user-agent"] = event["headers"]["user-agent"]
|
||||
payload["position"] = f'{payload["lat"]},{payload["lon"]}'
|
||||
current_year = datetime.datetime.now().year
|
||||
if payload["datetime"].split("-")[0] not in [str(current_year), str(current_year-1), str(current_year+1)]:
|
||||
# skip any telm that's not last year, this year or next year
|
||||
print(payload)
|
||||
print("Not within time range - not suitable to add to queues")
|
||||
continue
|
||||
if time_delta:
|
||||
payload["upload_time_delta"] = time_delta
|
||||
if "uploader_position" in payload:
|
||||
|
@ -91,7 +91,7 @@ resource "aws_lambda_function" "sqs_to_s3" {
|
||||
resource "aws_lambda_event_source_mapping" "sqs_to_s3" {
|
||||
event_source_arn = aws_sqs_queue.sqs_to_s3.arn
|
||||
function_name = aws_lambda_function.sqs_to_s3.arn
|
||||
batch_size = 5
|
||||
batch_size = 3
|
||||
maximum_batching_window_in_seconds = 15
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user