(oldObj interface{}, newObj interface{})
| 184 | } |
| 185 | |
| 186 | func (a *activator) updateAPI(oldObj interface{}, newObj interface{}) { |
| 187 | apiMetadata, err := getAPIMeta(newObj) |
| 188 | if err != nil { |
| 189 | a.logger.Errorw("error during virtual service informer update callback", zap.Error(err)) |
| 190 | telemetry.Error(err) |
| 191 | return |
| 192 | } |
| 193 | |
| 194 | if apiMetadata.apiKind != userconfig.RealtimeAPIKind { |
| 195 | return |
| 196 | } |
| 197 | |
| 198 | apiName := apiMetadata.apiName |
| 199 | |
| 200 | oldAPIMetatada, err := getAPIMeta(oldObj) |
| 201 | if err != nil { |
| 202 | a.logger.Errorw("error during virtual service informer update callback", zap.Error(err)) |
| 203 | telemetry.Error(err) |
| 204 | return |
| 205 | } |
| 206 | |
| 207 | if oldAPIMetatada.maxConcurrency != apiMetadata.maxConcurrency || oldAPIMetatada.maxQueueLength != apiMetadata.maxQueueLength { |
| 208 | a.logger.Debugw("updating api activator", zap.String("apiName", apiName)) |
| 209 | |
| 210 | a.activatorsMux.Lock() |
| 211 | a.apiActivators[apiName].updateQueueParams(apiMetadata.maxQueueLength, apiMetadata.maxConcurrency) |
| 212 | a.activatorsMux.Unlock() |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | func (a *activator) removeAPI(obj interface{}) { |
| 217 | apiMetadata, err := getAPIMeta(obj) |
nothing calls this directly
no test coverage detected