(o, url, env)
| 501 | } |
| 502 | |
| 503 | function tsa(o, url, env) { |
| 504 | const x = o.target_session_attrs || url.searchParams.get('target_session_attrs') || env.PGTARGETSESSIONATTRS |
| 505 | if (!x || ['read-write', 'read-only', 'primary', 'standby', 'prefer-standby'].includes(x)) |
| 506 | return x |
| 507 | |
| 508 | throw new Error('target_session_attrs ' + x + ' is not supported') |
| 509 | } |
| 510 | |
| 511 | function backoff(retries) { |
| 512 | return (0.5 + Math.random() / 2) * Math.min(3 ** retries / 100, 20) |