You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When a Sanic app is in production, I use different configs for development, staging, and production. I use 3 YAML files to implement that. However, they are not tracked by auto_reload in the development environment. I would be happy to be able to see Sanic can restart when I change the config.
Describe the solution you'd like
It can be a helper API to register resources for auto_reload. importlib provides a semantic method importlib.resources.read_text. It does no more than read(, 'r'). It might be nice to hook with readers from importlib.
@erickguan I am really glad that you suggested this. It is something that I think I have thought in my head many times would be really helpful to have.
Is your feature request related to a problem? Please describe.
When a Sanic app is in production, I use different configs for development, staging, and production. I use 3 YAML files to implement that. However, they are not tracked by auto_reload in the development environment. I would be happy to be able to see Sanic can restart when I change the config.
Describe the solution you'd like
It can be a helper API to register resources for auto_reload. importlib provides a semantic method
importlib.resources.read_text
. It does no more than read(, 'r'). It might be nice to hook with readers from importlib.Additional context
Example app structure:
Potential API signature:
sanic.resources.read_text(package, resource, encoding='utf-8', errors='strict')
The text was updated successfully, but these errors were encountered: