IOLoop cleanup
This commit is contained in:
1 parent
611a32d110
commit
e92b5d95ca
2 files changed
+6
-3
No files matched your search
+5
-2
@@ -1,6 +1,5 @@
|
|||||||
from flask.blueprints import Blueprint
|
from flask.blueprints import Blueprint
|
||||||
from flask.helpers import url_for
|
from flask.helpers import url_for
|
||||||
from tornado.ioloop import IOLoop
|
|
||||||
from tornado.web import RequestHandler, asynchronous
|
from tornado.web import RequestHandler, asynchronous
|
||||||
from werkzeug.utils import redirect
|
from werkzeug.utils import redirect
|
||||||
|
|
||||||
@@ -11,7 +10,11 @@ api_nonblock = {}
|
|||||||
|
|
||||||
|
|
||||||
class NonBlockHandler(RequestHandler):
|
class NonBlockHandler(RequestHandler):
|
||||||
stoppers = []
|
|
||||||
|
def __init__(self, application, request, **kwargs):
|
||||||
|
cls = NonBlockHandler
|
||||||
|
cls.stoppers = []
|
||||||
|
super(NonBlockHandler, self).__init__(application, request, **kwargs)
|
||||||
|
|
||||||
@asynchronous
|
@asynchronous
|
||||||
def get(self, route):
|
def get(self, route):
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ from couchpotato.api import api, NonBlockHandler
|
|||||||
from couchpotato.core.event import fireEventAsync, fireEvent
|
from couchpotato.core.event import fireEventAsync, fireEvent
|
||||||
from couchpotato.core.helpers.variable import getDataDir, tryInt
|
from couchpotato.core.helpers.variable import getDataDir, tryInt
|
||||||
from logging import handlers
|
from logging import handlers
|
||||||
from tornado.ioloop import IOLoop
|
|
||||||
from tornado.web import Application, FallbackHandler
|
from tornado.web import Application, FallbackHandler
|
||||||
from tornado.wsgi import WSGIContainer
|
from tornado.wsgi import WSGIContainer
|
||||||
from werkzeug.contrib.cache import FileSystemCache
|
from werkzeug.contrib.cache import FileSystemCache
|
||||||
@@ -231,6 +230,7 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En
|
|||||||
fireEventAsync('app.load')
|
fireEventAsync('app.load')
|
||||||
|
|
||||||
# Go go go!
|
# Go go go!
|
||||||
|
from tornado.ioloop import IOLoop
|
||||||
web_container = WSGIContainer(app)
|
web_container = WSGIContainer(app)
|
||||||
web_container._log = _log
|
web_container._log = _log
|
||||||
loop = IOLoop.instance()
|
loop = IOLoop.instance()
|
||||||
|
|||||||
Reference in new issue
Block a user