| 733 | |
| 734 | |
| 735 | def trace_task_ret(name, uuid, request, body, content_type, |
| 736 | content_encoding, loads=loads_message, app=None, |
| 737 | **extra_request): |
| 738 | app = app or current_app._get_current_object() |
| 739 | embed = None |
| 740 | if content_type: |
| 741 | accept = prepare_accept_content(app.conf.accept_content) |
| 742 | args, kwargs, embed = loads( |
| 743 | body, content_type, content_encoding, accept=accept, |
| 744 | ) |
| 745 | else: |
| 746 | args, kwargs, embed = body |
| 747 | hostname = gethostname() |
| 748 | request.update({ |
| 749 | 'args': args, 'kwargs': kwargs, |
| 750 | 'hostname': hostname, 'is_eager': False, |
| 751 | }, **embed or {}) |
| 752 | R, I, T, Rstr = trace_task(app.tasks[name], |
| 753 | uuid, args, kwargs, request, app=app) |
| 754 | return (1, R, T) if I else (0, Rstr, T) |
| 755 | |
| 756 | |
| 757 | def fast_trace_task(task, uuid, request, body, content_type, |