Skip to content
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

[Bug] sanic-ext seems to be instantiated twice when running in debug mode #25

Closed
prryplatypus opened this issue Dec 21, 2021 · 1 comment

Comments

@prryplatypus
Copy link
Member

Describe the bug
When the Sanic app is ran with debug=True, it seems like sanic-ext is being instantiated twice (maybe due to the reloader?).

Screenshots
Debug mode:
Debug mode on

Non-debug mode:
Debug mode off

To Reproduce
Create a Sanic app, load sanic-ext into it and run it using debug mode.

Expected behavior
Only one instance of sanic-ext is instantiated, or at least it's only logged once

Environment (please complete the following information):

  • OS: Windows 10 Home 21H1
  • Browser: N/A
  • Version: Sanic-Ext 21.9.3; Sanic 21.9.3; Routing 0.7.2

Additional context
N/A

@ahopkins
Copy link
Member

Not a bug. It is logging twice because you are extending in the global scope, which is executed once in the main process and once in the worker process. This will behave differently starting in the next release based upon sanic-org/sanic#2308

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

No branches or pull requests

2 participants