(event common.ChangePayload)
| 485 | } |
| 486 | |
| 487 | func (w *Worker) handleEndpointEvent(event common.ChangePayload) { |
| 488 | endpoint, ok := event.Payload.(params.ForgeEndpoint) |
| 489 | if !ok { |
| 490 | slog.DebugContext(w.ctx, "invalid payload type for endpoint event", "payload", event.Payload) |
| 491 | return |
| 492 | } |
| 493 | switch event.Operation { |
| 494 | case common.UpdateOperation, common.CreateOperation: |
| 495 | cache.SetEndpoint(endpoint) |
| 496 | entities := cache.GetEntitiesUsingEndpoint(endpoint) |
| 497 | for _, entity := range entities { |
| 498 | worker, ok := w.toolsWorkes[entity.ID] |
| 499 | if ok { |
| 500 | worker.Reset() |
| 501 | } |
| 502 | } |
| 503 | case common.DeleteOperation: |
| 504 | cache.RemoveEndpoint(endpoint.Name) |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | func (w *Worker) handleControllerInfoEvent(event common.ChangePayload) { |
| 509 | ctrlInfo, ok := event.Payload.(params.ControllerInfo) |
no test coverage detected