Refresh session after each harvest stage

Otherwise the eg the source config got cached and you needed to restart
the consumers to refresh it.
This commit is contained in:
amercader 2013-03-01 12:52:58 +00:00
parent 1f2467af33
commit 5c17a525c1
1 changed files with 2 additions and 1 deletions

View File

@ -143,6 +143,7 @@ def gather_callback(channel, method, header, body):
except KeyError: except KeyError:
log.error('No harvest job id received') log.error('No harvest job id received')
finally: finally:
model.Session.remove()
channel.basic_ack(method.delivery_tag) channel.basic_ack(method.delivery_tag)
@ -214,7 +215,7 @@ def fetch_callback(channel, method, header, body):
else: else:
obj.report_status = 'added' obj.report_status = 'added'
obj.save() obj.save()
model.Session.remove()
channel.basic_ack(method.delivery_tag) channel.basic_ack(method.delivery_tag)
def get_gather_consumer(): def get_gather_consumer():