From 4ae8678a5ebf45393fd76d6aa15bd7ffed7d8879 Mon Sep 17 00:00:00 2001 From: xss Date: Sat, 12 Feb 2022 18:59:57 +1100 Subject: [PATCH] don't send to sns if empty --- lambda/sonde_api_to_iot_core/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lambda/sonde_api_to_iot_core/__init__.py b/lambda/sonde_api_to_iot_core/__init__.py index ac28ae5..6375cd5 100644 --- a/lambda/sonde_api_to_iot_core/__init__.py +++ b/lambda/sonde_api_to_iot_core/__init__.py @@ -349,7 +349,8 @@ def upload(event, context): # last = to_sns.pop() # to_sns = to_sns[::3] # to_sns.append(last) - post(to_sns) + if len(to_sns) > 0: + post(to_sns) return errors def lambda_handler(event, context): try: