-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Why not add the sanic.worker.GunicornWorker to Gunicorn default worker_class #956
Comments
Moot point probably, but |
thank you for your reply. Sry, that's my spelling mistake. the spelling is correct on the code """ this is gunicron source code"""
class Config(object):
def __init__(self, usage=None, prog=None):
self.settings = make_settings()
self.usage = usage
self.prog = prog or os.path.basename(sys.argv[0])
self.env_orig = os.environ.copy()
def __getattr__(self, name):
if name not in self.settings:
raise AttributeError("No configuration setting for: %s" % name)
return self.settings[name].get()
def __setattr__(self, name, value):
if name != "settings" and name in self.settings:
raise AttributeError("Invalid access!")
super(Config, self).__setattr__(name, value)
@property
def worker_class_str(self):
uri = self.settings['worker_class'].get()
## are we using a threaded worker?
is_sync = uri.endswith('SyncWorker') or uri == 'sync'
if is_sync and self.threads > 1:
return "threads"
return uri
def worker_class_str(self):
uri = self.settings['worker_class'].get()
return str(uri) # if i write this, it works
... If you add sanic to worker in gunicorn, it's like the worker of aiohttp, and I'll try to add sanic worker as the addition of aiohttp worker. In Gunicorn's source code, it's really OK |
Does it expect cmd line seems to work fine, or provide a config file
Maybe i misunderstand your question.. |
The |
You should avoid changing |
@yunstanford @messense |
In my project, what im using is gunicorn and oslo.config , and before i use flask + gunicorn + oslo.config,
gunicorn.app.base.BaseApplication
This can be written into my code, Why don't you add it to the default?I tried it:
So I can only change the gunicorn source code.
The text was updated successfully, but these errors were encountered: