Skip to content

Conversation

@jwatzman
Copy link

@jwatzman jwatzman commented Oct 12, 2024

The optional workers in #24 doesn't quite work right: because env variables are always strings, generate-dotenv.cjs will set these two new env vars to the string 'false' -- which is truthy. So the console and admin workers will always be deactivated unless we set the value to the string '' or similar, which is confusing for these boolean-sounding settings.

Instead, we can just check if the port number is set, and skip if not, which is nice that we don't need a new env var -- you can just set the port number to the empty string to deactivate. This does have a similar issue, in that if you set the port to '0', it will still try to activate the optional worker -- but parseListenPort will immediately yell that 0 is an invalid port so at least you know immediately.

The optional workers in getcord#24 doesn't quite work right: because env
variables are always strings, `generate-dotenv.cjs` will set these two
new env vars to the string `'false'` -- which is truthy. So the console
and admin workers will always be deactivated unless we set the value to
the string `''` or similar, which is confusing for these
boolean-sounding settings.

Instead, we can just check if the port number is set, and skip if not,
which is nice that we don't need a new env var -- you can just set the
port number to the empty string to deactivate.  This does have a similar
issue, in that if you set the port to `0'`, it will still try to
activate the optional worker -- but `parseListenPort` will immediately
yell that `0` is an invalid port so at least you know immediately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants