move application export to isso.run
When using Gunicorn or uWSGI to run `isso.dispatch` it would automatically initialize and a default Isso instance (and cause several logging messages), although never used. If you use uWSGI or Gunicorn, you have to change the module from `isso` to `isso.run`.
This commit is contained in:
parent
ebad039d0e
commit
adc722359d
@ -36,7 +36,7 @@ supply everything as command-line arguments):
|
|||||||
processes = 4
|
processes = 4
|
||||||
cache2 = name=hash,items=1024,blocksize=32
|
cache2 = name=hash,items=1024,blocksize=32
|
||||||
spooler = %d/mail
|
spooler = %d/mail
|
||||||
module = isso
|
module = isso.run
|
||||||
virtualenv = %d
|
virtualenv = %d
|
||||||
env = ISSO_SETTINGS=%d/sample.cfg
|
env = ISSO_SETTINGS=%d/sample.cfg
|
||||||
|
|
||||||
|
@ -184,4 +184,4 @@ To execute Isso, use a command similar to:
|
|||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
$ export ISSO_SETTINGS="/path/to/isso.cfg"
|
$ export ISSO_SETTINGS="/path/to/isso.cfg"
|
||||||
$ gunicorn -b localhost:8080 -w 4 --preload isso
|
$ gunicorn -b localhost:8080 -w 4 --preload isso.run
|
||||||
|
@ -223,7 +223,3 @@ def main():
|
|||||||
if ex.errno != errno.ENOENT:
|
if ex.errno != errno.ENOENT:
|
||||||
raise
|
raise
|
||||||
wsgi.SocketHTTPServer(sock, make_app(conf)).serve_forever()
|
wsgi.SocketHTTPServer(sock, make_app(conf)).serve_forever()
|
||||||
|
|
||||||
|
|
||||||
if sys.argv[0].endswith(("uwsgi", "gunicorn")):
|
|
||||||
application = make_app(Config.load(os.environ.get('ISSO_SETTINGS')))
|
|
||||||
|
8
isso/run.py
Normal file
8
isso/run.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# -*- encoding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from isso import make_app
|
||||||
|
from isso.core import Config
|
||||||
|
|
||||||
|
application = make_app(Config.load(os.environ.get('ISSO_SETTINGS')))
|
Loading…
Reference in New Issue
Block a user