INNER CODE UNIT · Go
func
WaveSpeedAI/waverless · cmd/initializers.go:613
func (a *capacitySpotPriceLookup) GetSpotPriceBySpec(specName string) (float64, string, bool) {
spotStatus := a.mgr.GetSpotStatusBySpec(specName)
if spotStatus == nil || spotStatus.Price <= 0 {
return 0, "", false
}
return spotStatus.Price, spotStatus.InstanceType, true
}
// propagateCapacityFailureToWorkers updates WAITING_NODE workers with capacity failure info
// and records status_events so the timeline reflects the real failure reason.
func (app *Application) propagateCapacityFailureToWorkers(event interfaces.CapacityEvent) {
ctx := app.ctx
specName := event.SpecName
// Find all endpoints using this spec
endpoints, err := app.mysqlRepo.Endpoint.GetBySpecName(ctx, specName)
if err != nil {
logger.WarnCtx(ctx, "propagateCapacityFailure: failed to get endpoints for spec %s: %v", specName, err)