moved ack to after save of raw

This commit is contained in:
Thomas Maddox 2013-05-22 10:40:09 -05:00
parent 6af84ef178
commit 54a1f5fb0e
2 changed files with 4 additions and 3 deletions

View File

@ -364,9 +364,6 @@ def process_raw_data(deployment, args, json_args):
values['json'] = json_args
record = STACKDB.create_rawdata(**values)
STACKDB.save(record)
aggregate_lifecycle(record)
aggregate_usage(record, body)
return record

View File

@ -87,11 +87,15 @@ class NovaConsumer(kombu.mixins.ConsumerMixin):
args = (routing_key, json.loads(body))
asJson = json.dumps(args)
# save raw and ack the message
raw = views.process_raw_data(self.deployment, args, asJson)
if raw:
self.processed += 1
message.ack()
views.aggregate_lifecycle(raw)
views.aggregate_usage(raw, args[1])
self._check_memory()
def _check_memory(self):