def METHOD_NAME(aggregate):
    """Helper function to ensure a clean shutdown."""
    while True:
        try:
            aggregate.METHOD_NAME()
            aggregate.finish()
            aggregate.end_log_output(interrupt=True)
            break
        except KeyboardInterrupt:
            log.warn(LOG_CHECK, _("user abort; force shutdown"))
            aggregate.end_log_output(interrupt=True)
            abort_now()