def do_run(self, arguments, s3, postgres, results):
for worker_result in results.raw_analyses:
# We don't want to store tasks that do book-keeping for Selinon's
# Dispatcher (starting uppercase)
if worker_result.worker[0].isupper():
continue
if not postgres.is_real_task_result(worker_result.task_result):
# Do not overwrite results stored on S3 with references to
# their version - this can occur on selective task runs.
continue
version_id = s3.store_task_result(arguments, worker_result.worker,
worker_result.task_result)
# Substitute task's result with version that we got on S3
worker_result.task_result = {'version_id': version_id}
try:
postgres.session.commit()
except SQLAlchemyError:
postgres.session.rollback()
raise
s3.store_base_file_record(arguments, results.to_dict())
result_collector.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录