def on_shutdown(func: F) -> F:
    """Mark a method as a shutdown hook for the service."""
    setattr(func, "__bentoml_shutdown_hook__", True)
    return func
Mark a method as a shutdown hook for the service.
src/_bentoml_sdk/decorators.py