def METHOD_NAME(*args, **kwargs):
    app.logger.info("App stopping")
    if hasattr(app, "storage_node_id"):
        app.logger.info(f"Deleting storage node {app.storage_node_id}")
        if not ApiRest().delete("/storage_node", data={"id": app.storage_node_id}):
            # Docker default stop timeout is 10s
            sleep(2)
            METHOD_NAME()
        else:
            app.logger.info(f"Deleted storage node {app.storage_node_id}")