Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable and warn on step tool usage after execution #774

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Disable step tools once done
  • Loading branch information
jpwilliams committed Dec 9, 2024
commit 842b58fc9a6526b6b6d40714b97a58f83d23429e
14 changes: 10 additions & 4 deletions packages/inngest/src/components/execution/v0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,16 @@ export class V0InngestExecution
public start() {
this.debug("starting V0 execution");

return (this.execution ??= this._start().then((result) => {
this.debug("result:", result);
return result;
}));
return (this.execution ??= this._start()
.then((result) => {
this.debug("result:", result);
return result;
})
.finally(() => {
// Disable step tools after execution; only needed to produce warnings
// for if something is keeping hold of these references.
this.fnArg?.step?.["_disable"]?.();
}));
}

private async _start(): Promise<ExecutionResult> {
Expand Down
14 changes: 10 additions & 4 deletions packages/inngest/src/components/execution/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,16 @@ class V1InngestExecution extends InngestExecution implements IInngestExecution {
public start() {
this.debug("starting V1 execution");

return (this.execution ??= this._start().then((result) => {
this.debug("result:", result);
return result;
}));
return (this.execution ??= this._start()
.then((result) => {
this.debug("result:", result);
return result;
})
.finally(() => {
// Disable step tools after execution; only needed to produce warnings
// for if something is keeping hold of these references.
this.fnArg?.step?.["_disable"]?.();
}));
}

/**
Expand Down
Loading