(id, { allowLsStart = true } = {})
| 1632 | const _probeInFlight = new Map(); |
| 1633 | |
| 1634 | export async function probeAccount(id, { allowLsStart = true } = {}) { |
| 1635 | const existing = _probeInFlight.get(id); |
| 1636 | if (existing) return existing; |
| 1637 | |
| 1638 | const account = accounts.find(a => a.id === id); |
| 1639 | if (!account) return null; |
| 1640 | |
| 1641 | if (!allowLsStart) { |
| 1642 | const admission = getLsAdmissionForAccount(id); |
| 1643 | const skipped = residentProbeSkip(account, admission); |
| 1644 | if (skipped) return skipped; |
| 1645 | } |
| 1646 | |
| 1647 | const promise = _probeAccountImpl(account, { allowLsStart }).finally(() => { |
| 1648 | _probeInFlight.delete(id); |
| 1649 | }); |
| 1650 | _probeInFlight.set(id, promise); |
| 1651 | return promise; |
| 1652 | } |
| 1653 | |
| 1654 | async function _probeAccountImpl(account, { allowLsStart = true } = {}) { |
| 1655 | let accountMaintenanceToken = null; |
no test coverage detected