def execute_if_needed(argument, spec, use_cache):
ps = status.get(spec.pipeline_id)
if (match_pipeline_id(argument, spec.pipeline_id) or
(argument == 'all') or
(argument == 'dirty' and ps.dirty())):
if len(spec.validation_errors) != 0:
return (spec.pipeline_id, False, {}, ['init'] + list(map(str, spec.validation_errors))), \
spec.pipeline_id == argument
eid = gen_execution_id()
if ps.queue_execution(eid, 'manual'):
success, stats, errors = \
execute_pipeline(spec, eid,
use_cache=use_cache)
return (spec.pipeline_id, success, stats, errors), spec.pipeline_id == argument
else:
return (spec.pipeline_id, False, None, ['Already Running']), spec.pipeline_id == argument
return None, False
评论列表
文章目录