Show More
@@ -136,27 +136,35 b' def on_preload_parsed(options, **kwargs)' | |||
|
136 | 136 | @signals.task_success.connect |
|
137 | 137 | def task_success_signal(result, **kwargs): |
|
138 | 138 | meta.Session.commit() |
|
139 |
celery_app.conf['PYRAMID_CLOSER'] |
|
|
139 | closer = celery_app.conf['PYRAMID_CLOSER'] | |
|
140 | if closer: | |
|
141 | closer() | |
|
140 | 142 | |
|
141 | 143 | |
|
142 | 144 | @signals.task_retry.connect |
|
143 | 145 | def task_retry_signal( |
|
144 | 146 | request, reason, einfo, **kwargs): |
|
145 | 147 | meta.Session.remove() |
|
146 |
celery_app.conf['PYRAMID_CLOSER'] |
|
|
148 | closer = celery_app.conf['PYRAMID_CLOSER'] | |
|
149 | if closer: | |
|
150 | closer() | |
|
147 | 151 | |
|
148 | 152 | |
|
149 | 153 | @signals.task_failure.connect |
|
150 | 154 | def task_failure_signal( |
|
151 | 155 | task_id, exception, args, kwargs, traceback, einfo, **kargs): |
|
152 | 156 | meta.Session.remove() |
|
153 |
celery_app.conf['PYRAMID_CLOSER'] |
|
|
157 | closer = celery_app.conf['PYRAMID_CLOSER'] | |
|
158 | if closer: | |
|
159 | closer() | |
|
154 | 160 | |
|
155 | 161 | |
|
156 | 162 | @signals.task_revoked.connect |
|
157 | 163 | def task_revoked_signal( |
|
158 | 164 | request, terminated, signum, expired, **kwargs): |
|
159 |
celery_app.conf['PYRAMID_CLOSER'] |
|
|
165 | closer = celery_app.conf['PYRAMID_CLOSER'] | |
|
166 | if closer: | |
|
167 | closer() | |
|
160 | 168 | |
|
161 | 169 | |
|
162 | 170 | def setup_celery_app(app, root, request, registry, closer, ini_location): |
General Comments 0
You need to be logged in to leave comments.
Login now