MCPcopy
hub / github.com/cortexlabs/cortex / removeAPI

Method removeAPI

pkg/activator/activator.go:216–235  ·  view source on GitHub ↗
(obj interface{})

Source from the content-addressed store, hash-verified

214}
215
216func (a *activator) removeAPI(obj interface{}) {
217 apiMetadata, err := getAPIMeta(obj)
218 if err != nil {
219 a.logger.Errorw("error during virtual service informer delete callback", zap.Error(err))
220 telemetry.Error(err)
221 return
222 }
223
224 if apiMetadata.apiKind != userconfig.RealtimeAPIKind {
225 return
226 }
227
228 a.logger.Debugw("deleting api activator", zap.String("apiName", apiMetadata.apiName))
229
230 a.activatorsMux.Lock()
231 delete(a.apiActivators, apiMetadata.apiName)
232 a.activatorsMux.Unlock()
233
234 a.reporter.RemoveAPI(apiMetadata.apiName)
235}
236
237func (a *activator) awakenAPI(apiName string) {
238 err := a.autoscalerClient.Awaken(

Callers

nothing calls this directly

Calls 5

ErrorFunction · 0.92
getAPIMetaFunction · 0.85
ErrorMethod · 0.80
RemoveAPIMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected