Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd1b7e37

Browse files
committed
review
1 parent38369c6 commitd1b7e37

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

‎coderd/agentapi/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (a *LogsAPI) BatchCreateLogs(ctx context.Context, req *agentproto.BatchCrea
144144
ifworkspaceAgent.LogsLength==0&&a.PublishWorkspaceUpdateFn!=nil {
145145
// If these are the first logs being appended, we publish a UI update
146146
// to notify the UI that logs are now available.
147-
err=a.PublishWorkspaceUpdateFn(ctx,&workspaceAgent,wspubsub.WorkspaceEventKindAgentLogsUpdate)
147+
err=a.PublishWorkspaceUpdateFn(ctx,&workspaceAgent,wspubsub.WorkspaceEventKindAgentFirstLogs)
148148
iferr!=nil {
149149
returnnil,xerrors.Errorf("publish workspace update: %w",err)
150150
}

‎coderd/workspaceagents.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func (api *API) patchWorkspaceAgentLogs(rw http.ResponseWriter, r *http.Request)
253253
}
254254

255255
api.publishWorkspaceUpdate(ctx,workspace.Workspace.OwnerID, wspubsub.WorkspaceEvent{
256-
Kind:wspubsub.WorkspaceEventKindAgentLogsUpdate,
256+
Kind:wspubsub.WorkspaceEventKindAgentLogsOverflow,
257257
WorkspaceID:workspace.Workspace.ID,
258258
AgentID:&workspaceAgent.ID,
259259
})
@@ -285,7 +285,7 @@ func (api *API) patchWorkspaceAgentLogs(rw http.ResponseWriter, r *http.Request)
285285
}
286286

287287
api.publishWorkspaceUpdate(ctx,workspace.Workspace.OwnerID, wspubsub.WorkspaceEvent{
288-
Kind:wspubsub.WorkspaceEventKindAgentLogsUpdate,
288+
Kind:wspubsub.WorkspaceEventKindAgentFirstLogs,
289289
WorkspaceID:workspace.Workspace.ID,
290290
AgentID:&workspaceAgent.ID,
291291
})

‎coderd/workspaces.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,9 +1698,7 @@ func (api *API) watchWorkspace(rw http.ResponseWriter, r *http.Request) {
16981698
defercancelWorkspaceSubscribe()
16991699

17001700
// This is required to show whether the workspace is up-to-date.
1701-
cancelTemplateSubscribe,err:=api.Pubsub.Subscribe(watchTemplateChannel(workspace.TemplateID),func(ctx context.Context,msg []byte) {
1702-
sendUpdate(ctx,nil)
1703-
})
1701+
cancelTemplateSubscribe,err:=api.Pubsub.Subscribe(watchTemplateChannel(workspace.TemplateID),sendUpdate)
17041702
iferr!=nil {
17051703
_=sendEvent(ctx, codersdk.ServerSentEvent{
17061704
Type:codersdk.ServerSentEventTypeError,

‎coderd/wspubsub/wspubsub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ const (
4949
WorkspaceEventKindAppHealthUpdateWorkspaceEventKind="app_health"
5050

5151
WorkspaceEventKindAgentLifecycleUpdateWorkspaceEventKind="agt_lifecycle_update"
52-
WorkspaceEventKindAgentLogsUpdateWorkspaceEventKind="agt_logs_update"
5352
WorkspaceEventKindAgentConnectionUpdateWorkspaceEventKind="agt_connection_update"
53+
WorkspaceEventKindAgentFirstLogsWorkspaceEventKind="agt_first_logs"
5454
WorkspaceEventKindAgentLogsOverflowWorkspaceEventKind="agt_logs_overflow"
5555
WorkspaceEventKindAgentTimeoutWorkspaceEventKind="agt_timeout"
5656
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp