This commit is contained in:
		@@ -90,15 +90,18 @@ def on_message_creator(mqtt_: MQTT):
 | 
			
		||||
                )
 | 
			
		||||
            except requests.exceptions.Timeout:
 | 
			
		||||
                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:
 | 
			
		||||
                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():
 | 
			
		||||
                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']}...")
 | 
			
		||||
            mqtt_.publish(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user