reload env file on hot reload in granian#5510
Conversation
There was a problem hiding this comment.
PR Summary
Added support for automatic environment variable reloading in Granian hot reload mode, improving developer experience by ensuring .env file changes are reflected without manual server restarts.
- Added
_reload_hookinreflex/utils/exec.pyto handle environment reloading during Granian hot reload events - Moved dotenv loading logic from
config.pytoenvironment.pyfor better code organization - Added
_load_dotenv_from_strand_load_dotenv_from_envinenvironment.pyto handle colon-separated env file paths - Updated Granian dependency to
>=2.4.0inpyproject.tomlto support new reload functionality
4 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile
CodSpeed Performance ReportMerging #5510 will not alter performanceComparing Summary
|
|
@adhami3310 it seems to me you can actually get rid of the hook and directly pass edit: see https://github.com/emmett-framework/granian/blob/v2.4.0/granian/server/common.py#L479 |
|
@gi0baro that seems cleaner, i will look into it, thanks for the comment :D |
No description provided.