(tag)
| 3392 | return eq ? eq.split('=').slice(1).join('=') : null; |
| 3393 | } |
| 3394 | async function ensureRegistered(tag) { |
| 3395 | if (!getHubNodeSecret()) { |
| 3396 | console.log('[' + tag + '] No node_secret found. Registering with Hub...'); |
| 3397 | const hello = await sendHelloToHub(); |
| 3398 | if (!hello || !hello.ok) { |
| 3399 | console.error('[' + tag + '] Failed to register with Hub:', (hello && hello.error) || 'unknown'); |
| 3400 | process.exit(1); |
| 3401 | } |
| 3402 | console.log('[' + tag + '] Registered as ' + getNodeId()); |
| 3403 | } |
| 3404 | } |
| 3405 | // True when the hub rejected our node_secret as stale/invalid — the one |
| 3406 | // case where a rotate-and-retry is the documented recovery. |
| 3407 | function isStaleSecret(result) { |
no test coverage detected