Skip to content

Commit

Permalink
Adds batch tracing support check
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Feb 8, 2024
1 parent d8a68da commit 72055c6
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion js/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,22 @@ export class Client {
signal: AbortSignal.timeout(this.timeout_ms),
}
);
await raiseForStatus(response, "batch create run");
if (response.status === 404) {
this.autoBatchTracing = false;
for (const preparedCreateParam of body.post) {
await this.createRun(preparedCreateParam as CreateRunParams);
}
for (const preparedUpdateParam of body.patch) {
if (preparedUpdateParam.id !== undefined) {
await this.updateRun(
preparedUpdateParam.id,
preparedUpdateParam as UpdateRunParams
);
}
}
} else {
await raiseForStatus(response, "batch create run");
}
}

public async updateRun(runId: string, run: RunUpdate): Promise<void> {
Expand Down

0 comments on commit 72055c6

Please sign in to comment.