(event common.ChangePayload)
| 383 | } |
| 384 | |
| 385 | func (w *Worker) handlePoolEvent(event common.ChangePayload) { |
| 386 | pool, ok := event.Payload.(params.Pool) |
| 387 | if !ok { |
| 388 | slog.DebugContext(w.ctx, "invalid payload type for pool event", "payload", event.Payload) |
| 389 | return |
| 390 | } |
| 391 | entity, err := pool.GetEntity() |
| 392 | if err != nil { |
| 393 | slog.DebugContext(w.ctx, "getting entity from pool", "error", err) |
| 394 | return |
| 395 | } |
| 396 | |
| 397 | switch event.Operation { |
| 398 | case common.CreateOperation, common.UpdateOperation: |
| 399 | cache.SetEntityPool(entity.ID, pool) |
| 400 | case common.DeleteOperation: |
| 401 | cache.DeleteEntityPool(entity.ID, pool.ID) |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | func (w *Worker) handleScaleSetEvent(event common.ChangePayload) { |
| 406 | scaleSet, ok := event.Payload.(params.ScaleSet) |
no test coverage detected