mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 18:21:03 -03:30
Merge pull request #6132 from chrismeyersfsu/fix-ack_fact_scan_messages
ack fact scan messages
This commit is contained in:
@@ -61,12 +61,15 @@ class FactBrokerWorker(ConsumerMixin):
|
|||||||
host_obj = Host.objects.get(name=hostname, inventory__id=inventory_id)
|
host_obj = Host.objects.get(name=hostname, inventory__id=inventory_id)
|
||||||
except Fact.DoesNotExist:
|
except Fact.DoesNotExist:
|
||||||
logger.warn('Failed to intake fact. Host does not exist <hostname, inventory_id> <%s, %s>' % (hostname, inventory_id))
|
logger.warn('Failed to intake fact. Host does not exist <hostname, inventory_id> <%s, %s>' % (hostname, inventory_id))
|
||||||
|
message.ack()
|
||||||
return
|
return
|
||||||
except Fact.MultipleObjectsReturned:
|
except Fact.MultipleObjectsReturned:
|
||||||
logger.warn('Database inconsistent. Multiple Hosts found for <hostname, inventory_id> <%s, %s>.' % (hostname, inventory_id))
|
logger.warn('Database inconsistent. Multiple Hosts found for <hostname, inventory_id> <%s, %s>.' % (hostname, inventory_id))
|
||||||
|
message.ack()
|
||||||
return None
|
return None
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Exception communicating with Fact Cache Database: %s" % str(e))
|
logger.error("Exception communicating with Fact Cache Database: %s" % str(e))
|
||||||
|
message.ack()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
(module_name, facts) = self.process_facts(facts_data)
|
(module_name, facts) = self.process_facts(facts_data)
|
||||||
@@ -84,6 +87,7 @@ class FactBrokerWorker(ConsumerMixin):
|
|||||||
logger.info('Created new fact <fact_id, module> <%s, %s>' % (fact_obj.id, module_name))
|
logger.info('Created new fact <fact_id, module> <%s, %s>' % (fact_obj.id, module_name))
|
||||||
analytics_logger.info('Received message with fact data', extra=dict(
|
analytics_logger.info('Received message with fact data', extra=dict(
|
||||||
module_name=module_name, facts_data=facts))
|
module_name=module_name, facts_data=facts))
|
||||||
|
message.ack()
|
||||||
return fact_obj
|
return fact_obj
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user