fix(cli): elect managed service by port bind (#37572)
Co-authored-by: Dax Raad <thdxr@users.noreply.github.com>
This commit is contained in:
parent
987242b3e8
commit
6ea8247e0f
6 changed files with 232 additions and 39 deletions
|
|
@ -30,6 +30,12 @@ export function filename(channel = InstallationChannel) {
|
|||
return `service-${Hash.fast(channel)}.json`
|
||||
}
|
||||
|
||||
export function defaultPort(channel = InstallationChannel) {
|
||||
if (channel === "latest") return 0xc0de
|
||||
if (channel === "local") return 0xc0df
|
||||
return 10_000 + (Number.parseInt(Hash.fast(channel).slice(0, 8), 16) % 50_000)
|
||||
}
|
||||
|
||||
export function versionBelongsToChannel(
|
||||
version: string | undefined,
|
||||
channel = InstallationChannel,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue