Skip to content

Commit 54e3623

Browse files
authored
fix: initialize qstash client if it's not passed (#130)
1 parent d68057a commit 54e3623

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/serve/options.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ export const processOptions = <TResponse extends Response = Response, TInitialPa
4444
);
4545

4646
return {
47-
qstashClient: new Client({
48-
baseUrl: environment.QSTASH_URL!,
49-
token: environment.QSTASH_TOKEN!,
50-
}),
47+
qstashClient:
48+
options?.qstashClient ??
49+
new Client({
50+
baseUrl: environment.QSTASH_URL!,
51+
token: environment.QSTASH_TOKEN!,
52+
}),
5153
onStepFinish: (workflowRunId, _finishCondition, detailedFinishCondition) => {
5254
if (detailedFinishCondition?.condition === "auth-fail") {
5355
console.error(AUTH_FAIL_MESSAGE);

0 commit comments

Comments
 (0)