(uuid string)
| 378 | } |
| 379 | |
| 380 | func (m *OpCache) DeleteUUID(uuid string) { |
| 381 | deleted := false |
| 382 | for _, k := range m.status.Keys() { |
| 383 | if m.status.Get(k) == uuid { |
| 384 | m.status.Delete(k) |
| 385 | m.backendOps.Delete(k) // Also clean up the backend flag |
| 386 | deleted = true |
| 387 | } |
| 388 | } |
| 389 | if !deleted { |
| 390 | return |
| 391 | } |
| 392 | m.mu.RLock() |
| 393 | nc := m.nats |
| 394 | m.mu.RUnlock() |
| 395 | if nc != nil { |
| 396 | if err := nc.Publish(messaging.SubjectGalleryOpEnd, OpCacheEvent{JobID: uuid}); err != nil { |
| 397 | xlog.Warn("OpCache failed to broadcast end", "job_id", uuid, "error", err) |
| 398 | } |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | func (m *OpCache) Map() map[string]string { |
| 403 | return m.status.Map() |
no test coverage detected