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

Commitf6909ff

Browse files
committed
chore: polish
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
1 parent74f5dd7 commitf6909ff

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎enterprise/coderd/prebuilds/reconcile.go‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type StoreReconciler struct {
4444
running atomic.Bool
4545
stopped atomic.Bool
4646
donechanstruct{}
47-
provisionNotifyChchan*database.ProvisionerJob
47+
provisionNotifyChchan database.ProvisionerJob
4848
}
4949

5050
var_ prebuilds.ReconciliationOrchestrator=&StoreReconciler{}
@@ -64,7 +64,7 @@ func NewStoreReconciler(store database.Store,
6464
clock:clock,
6565
registerer:registerer,
6666
done:make(chanstruct{},1),
67-
provisionNotifyCh:make(chan*database.ProvisionerJob,100),
67+
provisionNotifyCh:make(chan database.ProvisionerJob,10),
6868
}
6969

7070
reconciler.metrics=NewMetricsCollector(store,logger,reconciler)
@@ -117,11 +117,7 @@ func (c *StoreReconciler) Run(ctx context.Context) {
117117
case<-ctx.Done():
118118
return
119119
casejob:=<-c.provisionNotifyCh:
120-
ifjob==nil {
121-
continue
122-
}
123-
124-
err:=provisionerjobs.PostJob(c.pubsub,*job)
120+
err:=provisionerjobs.PostJob(c.pubsub,job)
125121
iferr!=nil {
126122
c.logger.Error(ctx,"failed to post provisioner job to pubsub",slog.Error(err))
127123
}
@@ -600,9 +596,13 @@ func (c *StoreReconciler) provision(
600596
returnxerrors.Errorf("provision workspace: %w",err)
601597
}
602598

599+
ifprovisionerJob==nil {
600+
returnnil
601+
}
602+
603603
// Publish provisioner job event outside of transaction.
604604
select {
605-
casec.provisionNotifyCh<-provisionerJob:
605+
casec.provisionNotifyCh<-*provisionerJob:
606606
default:// channel full, drop the message; provisioner will pick this job up later with its periodic check, though.
607607
c.logger.Warn(ctx,"provisioner job notification queue full, dropping",
608608
slog.F("job_id",provisionerJob.ID),slog.F("prebuild_id",prebuildID.String()))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp