Starting a running flow restarts its nodes, so interval and cron Injects keep firing; a params-dict node is told settings arrive by name
This commit is contained in:
@@ -659,13 +659,19 @@ class FlowController:
|
||||
await self._acquire(FLOW_REBUILD_WAIT)
|
||||
try:
|
||||
if enabled:
|
||||
running = flow not in self.disabled
|
||||
# The gate first: a subscription that fires the instant it
|
||||
# starts must not be turned away by a flag on its way out.
|
||||
self.disabled = self.disabled - {flow}
|
||||
self.pipeline.set_disabled(self.disabled)
|
||||
# Lifts any quarantine, which is what a rebuild used to do by
|
||||
# throwing the whole supervisor away.
|
||||
await self.supervisor.cancel_flow(flow)
|
||||
# throwing the whole supervisor away. A running flow's nodes
|
||||
# are stopped first: a node already started returns from
|
||||
# start() at once, which would leave its cancelled loop dead.
|
||||
if running:
|
||||
await self._teardown(flow)
|
||||
else:
|
||||
await self.supervisor.cancel_flow(flow)
|
||||
await self._activate(flow)
|
||||
else:
|
||||
self.disabled = self.disabled | {flow}
|
||||
@@ -1989,10 +1995,14 @@ def _signature_gap(
|
||||
if not missing:
|
||||
return None
|
||||
kind = "an input" if missing[0] in ports else "a setting"
|
||||
return (
|
||||
gap = (
|
||||
f"'{missing[0]}' is {kind} of '{node_id}' but "
|
||||
f"process({', '.join(names)}) takes no such argument"
|
||||
)
|
||||
if kind == "a setting" and "params" in names:
|
||||
# Code written for the `params` dict settings used to arrive in.
|
||||
gap += f". Settings arrive by name: process(..., {missing[0]})"
|
||||
return gap
|
||||
|
||||
|
||||
def follow_header(node: NodeDef, code: str, drop: bool = True) -> NodeDef:
|
||||
|
||||
Reference in New Issue
Block a user