(ownerKey: string)
| 480 | } |
| 481 | |
| 482 | function removeOwnerFromRing(ownerKey: string) { |
| 483 | const idx = queuedOwnerRing.indexOf(ownerKey) |
| 484 | if (idx === -1) return |
| 485 | queuedOwnerRing.splice(idx, 1) |
| 486 | if (queuedOwnerRing.length === 0) { |
| 487 | queuedOwnerCursor = 0 |
| 488 | return |
| 489 | } |
| 490 | if (idx < queuedOwnerCursor) { |
| 491 | queuedOwnerCursor-- |
| 492 | } else if (queuedOwnerCursor >= queuedOwnerRing.length) { |
| 493 | queuedOwnerCursor = 0 |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | function maybeCleanupOwner(ownerKey: string) { |
| 498 | const owner = ownerStates.get(ownerKey) |
no outgoing calls
no test coverage detected