Handle timeout for long polling