Shutdown the server if the flag has been set

def check_shutdown_flag(self):
        """Shutdown the server if the flag has been set"""
        if self.shutdown_requested:
            tornado.ioloop.IOLoop.instance().stop()
            print("web server stopped.")