def METHOD_NAME(func):
    """Decorator that sets up the a background task function
    with a database session and exception tracking.
    As background tasks run in their own threads, it does not attempt
    to propagate errors.
    """
    @wraps(func)
    def wrapper(*args, **kwargs):
        background = False
        if not kwargs.get("db_session"):
            if not kwargs.get("organization_slug"):
                raise Exception("If not db_session is supplied organization slug must be provided.")
            schema_engine = engine.execution_options(
                schema_translate_map={
                    None: f"dispatch_organization_{kwargs['organization_slug']}",
                }
            )
            db_session = sessionmaker(bind=schema_engine)
            background = True
            kwargs["db_session"] = db_session()
        try:
            metrics_provider.counter("function.call.counter", tags={"function": fullname(func)})
            start = time.perf_counter()
            result = func(*args, **kwargs)
            elapsed_time = time.perf_counter() - start
            metrics_provider.timer(
                "function.elapsed.time", value=elapsed_time, tags={"function": fullname(func)}
            )
            return result
        except Exception as e:
            log.exception(e)
        finally:
            if background:
                kwargs["db_session"].close()
    return wrapper