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

Commitd8cd584

Browse files
committed
review
1 parent4fb878d commitd8cd584

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
@@ -252,7 +252,7 @@ func (api *API) patchWorkspaceAgentLogs(rw http.ResponseWriter, r *http.Request)
252252
}
253253

254254
api.publishWorkspaceUpdate(ctx,workspace.Workspace.OwnerID, wspubsub.WorkspaceEvent{
255-
Kind:wspubsub.WorkspaceEventKindAgentLogsUpdate,
255+
Kind:wspubsub.WorkspaceEventKindAgentLogsOverflow,
256256
WorkspaceID:workspace.Workspace.ID,
257257
AgentID:&workspaceAgent.ID,
258258
})
@@ -284,7 +284,7 @@ func (api *API) patchWorkspaceAgentLogs(rw http.ResponseWriter, r *http.Request)
284284
}
285285

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

‎coderd/workspaces.go‎

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

17261726
// This is required to show whether the workspace is up-to-date.
1727-
cancelTemplateSubscribe,err:=api.Pubsub.Subscribe(watchTemplateChannel(workspace.TemplateID),func(ctx context.Context,msg []byte) {
1728-
sendUpdate(ctx,nil)
1729-
})
1727+
cancelTemplateSubscribe,err:=api.Pubsub.Subscribe(watchTemplateChannel(workspace.TemplateID),sendUpdate)
17301728
iferr!=nil {
17311729
_=sendEvent(ctx, codersdk.ServerSentEvent{
17321730
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