Added nacking
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-07-28 14:17:45 +02:00
parent c6b444bc6d
commit e6afdd5bac

View File

@ -90,15 +90,18 @@ def on_message_creator(mqtt_: MQTT):
) )
except requests.exceptions.Timeout: except requests.exceptions.Timeout:
logging.error(f"Input-service timed out! (Timeout: {config.INPUT_TIMEOUT} sec)") logging.error(f"Input-service timed out! (Timeout: {config.INPUT_TIMEOUT} sec)")
return # no ack channel.basic_nack(delivery_tag=method.delivery_tag, requeue=True)
return
if r.status_code != 200: if r.status_code != 200:
logging.error(f"Input-service status code is not 200: {r.status_code}") logging.error(f"Input-service status code is not 200: {r.status_code}")
return # no ack channel.basic_nack(delivery_tag=method.delivery_tag, requeue=True)
return
if 'device_id' not in r.json(): if 'device_id' not in r.json():
logging.error("Input-service response invalid") logging.error("Input-service response invalid")
return # no ack channel.basic_nack(delivery_tag=method.delivery_tag, requeue=True)
return
logging.info(f"Sending alert command to device {r.json()['device_id']}...") logging.info(f"Sending alert command to device {r.json()['device_id']}...")
mqtt_.publish( mqtt_.publish(