Skip to content

Commit

Permalink
fix json rpc watch
Browse files Browse the repository at this point in the history
  • Loading branch information
mustard-mh committed Nov 8, 2023
1 parent 8a448fb commit ed01347
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions components/dashboard/src/service/json-rpc-workspace-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ export class JsonRpcWorkspaceClient implements PromiseClient<typeof WorkspaceSer
if (!options?.signal) {
throw new ConnectError("signal is required", Code.InvalidArgument);
}
if (request.workspaceId) {
const resp = await this.getWorkspace({ id: request.workspaceId });
if (resp.item?.status) {
const response = new WatchWorkspaceStatusResponse();
response.status = resp.item.status;
yield response;
}
}
const it = generateAsyncGenerator<WorkspaceInstance>(
(queue) => {
try {
Expand All @@ -54,14 +62,6 @@ export class JsonRpcWorkspaceClient implements PromiseClient<typeof WorkspaceSer
},
{ signal: options.signal },
);
if (request.workspaceId) {
const resp = await this.getWorkspace({ id: request.workspaceId });
if (resp.item?.status) {
const response = new WatchWorkspaceStatusResponse();
response.status = resp.item.status;
yield response;
}
}
for await (const item of it) {
if (!item) {
continue;
Expand Down

0 comments on commit ed01347

Please sign in to comment.