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

Commit82a486f

Browse files
committed
fix: range over channel, add continue to default switch case
1 parent3a03b9d commit82a486f

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

‎coderd/autostart/lifecycle/lifecycle_executor.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,9 @@ func NewExecutor(ctx context.Context, db database.Store, log slog.Logger, tick <
3838
// tick from its channel. It will stop when its context is Done, or when
3939
// its channel is closed.
4040
func (e*Executor)Run() {
41-
for {
42-
select {
43-
caset:=<-e.tick:
44-
iferr:=e.runOnce(t);err!=nil {
45-
e.log.Error(e.ctx,"error running once",slog.Error(err))
46-
}
47-
case<-e.ctx.Done():
48-
return
49-
default:
41+
fort:=rangee.tick {
42+
iferr:=e.runOnce(t);err!=nil {
43+
e.log.Error(e.ctx,"error running once",slog.Error(err))
5044
}
5145
}
5246
}
@@ -94,6 +88,7 @@ func (e *Executor) runOnce(t time.Time) error {
9488
slog.F("workspace_id",ws.ID),
9589
slog.F("latest_build_transition",latestBuild.Transition),
9690
)
91+
continue
9792
}
9893

9994
// Round time to the nearest minute, as this is the finest granularity cron supports.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp