I have several large queries that I expect will return 50K+ records, but i seem to get consistent timeouts. I changed my query to SORT BY Id, as recommended in some posts, this worked for a while but they are timing out again.
my query processing code looks like:
Task<QueryResult<T>> task = client.QueryAsync<T>(soql);
var currentResultList = task.Result.Records;
listCount += currentResultList.Count;
task.Wait();
while (!string.IsNullOrEmpty(task.Result.NextRecordsUrl))
{
task = client.QueryContinuationAsync<T>(task.Result.NextRecordsUrl);
processCallback(currentResultList);
apiCount++;
task.Wait();
currentResultList = task.Result.Records;
listCount += currentResultList.Count;
}
processCallback(currentResultList);
}
}
catch (Exception ex)
{
HandleException(ex, $"QueryAndProcess exception occurred for user {userName} for Query {soql} attempting to access {url}");
}
I even tried to set the timeout on my own HTTP Client to 300 seconds but that make no difference, the exception occurs around 100-120 seconds.
myClient = new HttpClient();
myClient.Timeout = new TimeSpan(0,0,0,300);
client = new ForceClient(instanceUrl, accessToken, apiVersion, myClient);
is there another way to set a longer timeout?