Skip to content

Commit a7fcc4b

Browse files
ignacioalvarolopez
authored andcommitted
Decouple ModelWrapper from api
1 parent 55a9e6d commit a7fcc4b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

deepaas/model/v2/wrapper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class ModelWrapper(object):
102102
:raises HTTPInternalServerError: in case that a model has defined
103103
a response schema that is not JSON schema valid (DRAFT 4)
104104
"""
105-
def __init__(self, name, model_obj, app):
105+
def __init__(self, name, model_obj, app=None):
106106
self.name = name
107107
self.model_obj = model_obj
108108
self._app = app
@@ -112,7 +112,8 @@ def __init__(self, name, model_obj, app):
112112
self._workers = CONF.workers
113113
self._executor = self._init_executor()
114114

115-
self._setup_cleanup()
115+
if self._app is not None:
116+
self._setup_cleanup()
116117

117118
schema = getattr(self.model_obj, "schema", None)
118119

0 commit comments

Comments
 (0)