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

Commit2667684

Browse files
fix: hard-limiting should only apply to creation of prebuilds
1 parenta1a4f2a commit2667684

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

‎enterprise/coderd/prebuilds/reconcile.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -365,16 +365,10 @@ func (c *StoreReconciler) ReconcilePreset(ctx context.Context, ps prebuilds.Pres
365365
c.metrics.trackHardLimitedStatus(ps.Preset.OrganizationName,ps.Preset.TemplateName,ps.Preset.Name,ps.IsHardLimited)
366366
}
367367

368-
// If the preset was previously hard-limited, log it and exit early.
369-
ifps.Preset.PrebuildStatus==database.PrebuildStatusHardLimited {
370-
logger.Warn(ctx,"skipping hard limited preset")
371-
returnnil
372-
}
373-
374368
// If the preset reached the hard failure limit for the first time during this iteration:
375369
// - Mark it as hard-limited in the database
376370
// - Send notifications to template admins
377-
ifps.IsHardLimited {
371+
ifps.Preset.PrebuildStatus!=database.PrebuildStatusHardLimited&&ps.IsHardLimited {
378372
logger.Warn(ctx,"skipping hard limited preset")
379373

380374
err:=c.store.UpdatePresetPrebuildStatus(ctx, database.UpdatePresetPrebuildStatusParams{
@@ -388,10 +382,7 @@ func (c *StoreReconciler) ReconcilePreset(ctx context.Context, ps prebuilds.Pres
388382
err=c.notifyPrebuildFailureLimitReached(ctx,ps)
389383
iferr!=nil {
390384
logger.Error(ctx,"failed to notify that number of prebuild failures reached the limit",slog.Error(err))
391-
returnnil
392385
}
393-
394-
returnnil
395386
}
396387

397388
state:=ps.CalculateState()
@@ -456,6 +447,14 @@ func (c *StoreReconciler) ReconcilePreset(ctx context.Context, ps prebuilds.Pres
456447
actions.Create=desired
457448
}
458449

450+
ifactions.Create>0 {
451+
// If the preset is hard-limited, log it and exit early.
452+
ifps.Preset.PrebuildStatus==database.PrebuildStatusHardLimited||ps.IsHardLimited {
453+
logger.Warn(ctx,"skipping hard limited preset")
454+
returnnil
455+
}
456+
}
457+
459458
varmultiErr multierror.Error
460459

461460
forrangeactions.Create {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp