(ctx *InvokeContext)
| 277 | } |
| 278 | |
| 279 | func (controller *Controller) getRuntimeConfiguration(ctx *InvokeContext) (hitCache bool, err error) { |
| 280 | if ctx.RunOptions.RecommendedOptions.Features.EnableMetrics { |
| 281 | ctx.Metrics.StepStart(StageGetRuntimeConfiguration) |
| 282 | ctx.Metrics.StepStart(StageGetRuntimeConfigurationHitCache) |
| 283 | defer func() { |
| 284 | if hitCache { |
| 285 | ctx.Metrics.StepDone(StageGetRuntimeConfigurationHitCache) |
| 286 | ctx.Metrics.ScrapStage(StageGetRuntimeConfiguration) |
| 287 | } else { |
| 288 | ctx.Metrics.StepDone(StageGetRuntimeConfiguration) |
| 289 | ctx.Metrics.ScrapStage(StageGetRuntimeConfigurationHitCache) |
| 290 | } |
| 291 | ctx.Metrics.SetLabel(getConfigurationHitCacheLabel, strconv.FormatBool(hitCache)) |
| 292 | }() |
| 293 | } |
| 294 | |
| 295 | ctx.Logger.V(9).Info("get runtime configuration") |
| 296 | hitCache = false |
| 297 | |
| 298 | namep := ctx.Function.Configuration.Runtime |
| 299 | if namep == nil { |
| 300 | return hitCache, innerErr.NewServiceException("runtime name is nil pointer", nil) |
| 301 | } |
| 302 | name := *namep |
| 303 | |
| 304 | input := &api.GetRuntimeConfigurationInput{ |
| 305 | RuntimeName: name, |
| 306 | Authorization: ctx.Authorization, |
| 307 | RequestID: ctx.RequestID, |
| 308 | } |
| 309 | ctx.Runtime, hitCache, err = ctx.Clients.DataStorer.GetRuntimeConfiguration(input) |
| 310 | return hitCache, err |
| 311 | } |
| 312 | |
| 313 | func (controller *Controller) getRuntime(ctx *InvokeContext) (err error) { |
| 314 | runtimeT := api.RuntimeViaUnknown |
no test coverage detected