Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/ForceToolkitForNET/ForceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,13 @@ public async Task<List<BatchInfoResult>> RunJobAsync<T>(string objectName, strin
}

public async Task<List<BatchResultList>> RunJobAndPollAsync<T>(string objectName, BulkConstants.OperationType operationType,
IEnumerable<ISObjectList<T>> recordsLists)
IEnumerable<ISObjectList<T>> recordsLists, float? maxPollDelayMilliSeconds = null)
{
return await RunJobAndPollAsync(objectName, null, operationType, recordsLists);
return await RunJobAndPollAsync(objectName, null, operationType, recordsLists, maxPollDelayMilliSeconds);
}

public async Task<List<BatchResultList>> RunJobAndPollAsync<T>(string objectName, string externalIdFieldName, BulkConstants.OperationType operationType,
IEnumerable<ISObjectList<T>> recordsLists)
IEnumerable<ISObjectList<T>> recordsLists, float? maxPollDelayMilliSeconds = null)
{
const float pollingStart = 1000;
const float pollingIncrease = 2.0f;
Expand Down Expand Up @@ -345,6 +345,7 @@ public async Task<List<BatchResultList>> RunJobAndPollAsync<T>(string objectName

await Task.Delay((int)currentPoll);
currentPoll *= pollingIncrease;
if (maxPollDelayMilliSeconds != null && currentPoll > maxPollDelayMilliSeconds) currentPoll = (float)maxPollDelayMilliSeconds;
}


Expand Down
2 changes: 1 addition & 1 deletion src/ForceToolkitForNET/IForceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public interface IForceClient : IDisposable

// BULK
Task<List<BatchInfoResult>> RunJobAsync<T>(string objectName, BulkConstants.OperationType operationType, IEnumerable<ISObjectList<T>> recordsLists);
Task<List<BatchResultList>> RunJobAndPollAsync<T>(string objectName, BulkConstants.OperationType operationType, IEnumerable<ISObjectList<T>> recordsLists);
Task<List<BatchResultList>> RunJobAndPollAsync<T>(string objectName, BulkConstants.OperationType operationType, IEnumerable<ISObjectList<T>> recordsLists, float? maxPollDelayMilliSeconds = null);
Task<JobInfoResult> CreateJobAsync(string objectName, BulkConstants.OperationType operationType);
Task<BatchInfoResult> CreateJobBatchAsync<T>(JobInfoResult jobInfo, ISObjectList<T> recordsObject);
Task<BatchInfoResult> CreateJobBatchAsync<T>(string jobId, ISObjectList<T> recordsObject);
Expand Down