-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
feat: control dev mode with env var #877
Conversation
@VishnuSanal is attempting to deploy a commit to the sparckles Team on Vercel. A member of the Team first needs to authorize it. |
CodSpeed Performance ReportMerging #877 will not alter performanceComparing Summary
|
@@ -23,7 +23,7 @@ def __init__(self) -> None: | |||
"--dev", | |||
dest="dev", | |||
action="store_true", | |||
default=False, | |||
default=None, |
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.
Let's document this decision?
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.
@sansyrox It will be defaulted to false if an environment variable is not found. (since the fallback value to os.getenv
on cli#run
is false) Should we still document it?
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.
@VishnuSanal , I want you to document the decision that the env variable will have a priority over the cli flag.
I believe we should prioritise cli flag over the env variable.
Also, could you add a way to control the dev mode in |
the decision to turn on/off the dev mode would have been made before we reach |
And why is that? I thought you were implementing |
what I meant with "the decision to turn on/off the dev mode would have been made before we reach
I didn't get you? yeah, I am implementing the toggle for dev mode from env vars; but, in both cases, wouldn't the decision to switch to whether to start app normally or to start the dev server would have been made before the init? |
for more information, see https://pre-commit.ci
@VishnuSanal , updated the PR. Do have a look. |
@VishnuSanal , could you do a self review/review on my changes? And then I can do a final review 😄 |
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.
it doesn't work as expected in my testing.
(.venv) RobynApp $ python3 app.py
INFO:robyn.logger:SERVER IS RUNNING IN VERBOSE/DEBUG MODE. Set --log-level to WARN to run in production mode.
INFO:robyn.logger:Added route HttpMethod.GET /
INFO:robyn.logger:Robyn version: 0.56.1
INFO:robyn.logger:Starting server at http://0.0.0.0:8080
INFO:actix_server.builder:starting 1 workers
INFO:actix_server.server:Actix runtime found; starting in Actix runtime
^CINFO:actix_server.server:SIGINT received; starting forced shutdown
INFO:actix_server.worker:shutting down idle worker
INFO:actix_server.accept:accept thread stopped
Aborted (core dumped)
(.venv) RobynApp $ robyn app.py
Starting dev server...
Reloading /home/vishnu/Robyn/RobynApp/app.py...
INFO:robyn.logger:SERVER IS RUNNING IN VERBOSE/DEBUG MODE. Set --log-level to WARN to run in production mode.
INFO:robyn.logger:Added route HttpMethod.GET /
INFO:robyn.logger:Robyn version: 0.56.1
INFO:robyn.logger:Starting server at http://0.0.0.0:8080
INFO:actix_server.builder:starting 1 workers
INFO:actix_server.server:Actix runtime found; starting in Actix runtime
^CINFO:actix_server.server:SIGINT received; starting forced shutdown
INFO:actix_server.accept:accept thread stopped
INFO:actix_server.worker:shutting down idle worker
(.venv) RobynApp $ cat robyn.env
ROBYN_DEV_MODE=True
What is unexpected here @VishnuSanal ? |
I have the environemnt variable set to true, but no warning is shown when running |
@VishnuSanal , is it actually running in dev mode? |
it wasn't actually running in dev mode + the warning wasn't being shown, even after setting the env var. Please refer to the logs attached.
|
f6b088c
to
606588a
Compare
@VishnuSanal , have a look once. |
16faef2
to
47da13f
Compare
for more information, see https://pre-commit.ci
…oad-env-var # Conflicts: # robyn/reloader.py
yeps, works as expected! attaching the logs for reference.
|
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.
LGTM 😄
Description
This PR fixes #62