(app, callback, group_result)
Add the callback to the queue or mark the callback as failed
    Implementation borrowed from `celery.app.builtins.unlock_chord`
Add the callback to the queue or mark the callback as failed
    Implementation borrowed from `celery.app.builtins.unlock_chord`
Add the callback to the queue or mark the callback as failed Implementation borrowed from celery . app . builtins . unlock_chord
def trigger_callback(app, callback, group_result):
    """Add the callback to the queue or mark the callback as failed
    Implementation borrowed from `celery.app.builtins.unlock_chord`
    """
    if group_result.supports_native_join:
        j = group_result.join_native
    else:
        j = group_result.join

    try:
        with allow_join_result():
            ret = j(timeout=app.conf.result_chord_join_timeout, propagate=True)
    except Exception as exc:  # pylint: disable=broad-except
        try:
            culprit = next(group_result._failed_join_report())
            reason = f"Dependency {culprit.id} raised {exc!r}"
        except StopIteration:
            reason = repr(exc)
        logger.exception("Chord %r raised: %r", group_result.id, exc)
        app.backend.chord_error_from_stack(callback, ChordError(reason))
    else:
        try:
            callback.delay(ret)
        except Exception as exc:  # pylint: disable=broad-except
            logger.exception("Chord %r raised: %r", group_result.id, exc)
            app.backend.chord_error_from_stack(
                callback, exc=ChordError(f"Callback error: {exc!r}")
            )
def trigger_callback ( app , callback , group_result ) : if group_result . supports_native_join : j = group_result . join_native else : j = group_result . join try : with allow_join_result ( ) : ret = j ( timeout = app . conf . result_chord_join_timeout , propagate = True ) except Exception as exc : # pylint: disable=broad-except try : culprit = next ( group_result . _failed_join_report ( ) ) reason = f"Dependency {culprit.id} raised {exc!r}" except StopIteration : reason = repr ( exc ) logger . exception ( "Chord %r raised: %r" , group_result . id , exc ) app . backend . chord_error_from_stack ( callback , ChordError ( reason ) ) else : try : callback . delay ( ret ) except Exception as exc : # pylint: disable=broad-except logger . exception ( "Chord %r raised: %r" , group_result . id , exc ) app . backend . chord_error_from_stack ( callback , exc = ChordError ( f"Callback error: {exc!r}" ) )