-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow setting run mode via env, add helpers to determine it #4168
allow setting run mode via env, add helpers to determine it #4168
Conversation
Returns: | ||
True if the app is running in frontend-only mode. | ||
""" | ||
return os.environ.get(constants.ENV_FRONTEND_ONLY_ENV_VAR, "").lower() == "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some env vars, we're checking against ["true", "1", "yes"]
rather than just "true".
I think it'd be better to have an uniform method doing the check for boolean env var rather than duplicating logic everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review. I know, it's a mess currently. I think this needs a refactor over the whole repo, maybe we should address that one in a different PR later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i created #4172 to discuss/refactor boolean env var handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making that issue.
Yeah I'll approve this PR and we can clean up things over the whole repo in a different PR.
needs coordination with #4192 |
bonus: error out if backend-only and frontend-only is set at the same time
needed here: reflex-dev/reflex-chakra#22