If there is an error, it will not increment the retry count and this will hang. A simpler alternative would be to simply call the error callback if there is an error querying the data.