-
Notifications
You must be signed in to change notification settings - Fork 46
Allow search jobs to be created if going into a queued state #91
Conversation
@@ -234,12 +259,27 @@ async Task<Job> CreateAsync(IEnumerable<Argument> arguments, DispatchState requi | |||
|
|||
Job job = new Job(this.Context, this.Namespace, name: searchId); | |||
|
|||
await job.GetAsync().ConfigureAwait(false); | |||
await job.GetAsync(requiredState).ConfigureAwait(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously in CreateAsync()
we would ignore the requiredState
value and by default wait for every job to reach a created state before returning - resulting in timeouts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version will still time out if required state is running and we get queued though?
var dateString = input.ToString(); | ||
if (dateString.Trim().Equals("")) | ||
{ | ||
return DateTime.MinValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original XML parsing bug was addressed with this change
@@ -195,6 +195,31 @@ public override async Task<Job> CreateAsync(IEnumerable<Argument> arguments) | |||
return job; | |||
} | |||
|
|||
public virtual async Task<Job> Create(string search, int count = 0, // This version doesn't wait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove these, but I wanted to add another Create()
function that doesn't wait until a requiredStatus
is reached
await job.TransitionAsync(requiredState).ConfigureAwait(false); | ||
|
||
return job; | ||
} | ||
|
||
async Task<Job> Create(IEnumerable<Argument> arguments) // this version doesn't wait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internal helper used by the new Create()
above
|
||
try | ||
{ | ||
job = await service.Jobs.Create(searchPrefix + i.ToString(), args: jobArgs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test uses the new Create()
…quiredState passed in Also only use TLSv1.0 for CI
@@ -470,7 +471,8 @@ public virtual async Task GetAsync(DispatchState dispatchState, int delay = 3000 | |||
await response.EnsureStatusCodeAsync(HttpStatusCode.OK).ConfigureAwait(false); | |||
await this.ReconstructSnapshotAsync(response).ConfigureAwait(false); | |||
|
|||
if (this.DispatchState >= dispatchState) | |||
// None or Parsing are the only states to continue checking status for | |||
if (this.DispatchState >= dispatchState || this.DispatchState == DispatchState.Queued) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zenmoto see the change here
No description provided.