Cancelling timer only when server is shutdown.