@@ -365,16 +365,10 @@ func (c *StoreReconciler) ReconcilePreset(ctx context.Context, ps prebuilds.Pres
365
365
c .metrics .trackHardLimitedStatus (ps .Preset .OrganizationName ,ps .Preset .TemplateName ,ps .Preset .Name ,ps .IsHardLimited )
366
366
}
367
367
368
- // If the preset was previously hard-limited, log it and exit early.
369
- if ps .Preset .PrebuildStatus == database .PrebuildStatusHardLimited {
370
- logger .Warn (ctx ,"skipping hard limited preset" )
371
- return nil
372
- }
373
-
374
368
// If the preset reached the hard failure limit for the first time during this iteration:
375
369
// - Mark it as hard-limited in the database
376
370
// - Send notifications to template admins
377
- if ps .IsHardLimited {
371
+ if ps .Preset . PrebuildStatus != database . PrebuildStatusHardLimited && ps . IsHardLimited {
378
372
logger .Warn (ctx ,"skipping hard limited preset" )
379
373
380
374
err := c .store .UpdatePresetPrebuildStatus (ctx , database.UpdatePresetPrebuildStatusParams {
@@ -456,6 +450,14 @@ func (c *StoreReconciler) ReconcilePreset(ctx context.Context, ps prebuilds.Pres
456
450
actions .Create = desired
457
451
}
458
452
453
+ if actions .Create > 0 {
454
+ // If the preset is hard-limited, log it and exit early.
455
+ if ps .Preset .PrebuildStatus == database .PrebuildStatusHardLimited || ps .IsHardLimited {
456
+ logger .Warn (ctx ,"skipping hard limited preset" )
457
+ return nil
458
+ }
459
+ }
460
+
459
461
var multiErr multierror.Error
460
462
461
463
for range actions .Create {