rulvar API reference / @rulvar/core / nextFailover
Function: nextFailover()
ts
function nextFailover(
targets,
trigger,
from): number | undefined;Defined in: packages/core/src/model/failover.ts:51
The next target index past from that serves trigger, or undefined when the chain is exhausted. Index 0 is the primary; the chain never moves backwards (sticky failover).
Parameters
| Parameter | Type |
|---|---|
targets | Pick<FailoverTarget, "on">[] |
trigger | FailoverTrigger |
from | number |
Returns
number | undefined