Skip to content

Commit

Permalink
Addressed comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Cholewa committed Sep 26, 2016
1 parent 3425245 commit c762c4f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ Current

### Fixed:

- [Fixes a bug where job metadata was being stored in the `ApiJobStore` even when the results came back synchronously](https://github.com/yahoo/fili/pull/49)
* The workflow that updates the job's metadata with `success` was running even when the query was synchronous. That update had the impact of
storing the ticket in the ApiJobStore.
* The reason the delay operator didn't stop the update workflow from executing viewed an `Observable::onCompleted` as a message for the purpose of
delays. Since the two observables that that the metadata update it gated on are empty when the query is synchronous, the update metadata workflow
was being updated.
* The delay operator was replaced by `zipWith` as a gate.
- [#45, removing sorting from weight check queries](https://github.com/yahoo/fili/pull/46)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ private Observable<String> buildStorePreResponseChain(
// We don't want to store the result in the PreResponseStore unless the query is asynchronous. The query is
// asynchronous iff the asynchronousPayload emits at least one item.
return preResponseEmitter
// Using zip as a gate. We don't let the preResponse from the preResponse emitter continue down the
// chain until and unless the asynchronousPayload emits an item.
.zipWith(asynchronousPayload, (preResponse, ignored) -> preResponse)
.flatMap(preResponse -> preResponseStore.save(jobRow.getId(), preResponse));
}
Expand Down Expand Up @@ -206,7 +208,11 @@ private Observable<JobRow> buildUpdateRowChain(
// The job status should not be updated until both the PreResponse has been stored, and the storage of the
// original Job ticket has been attempted.
return preResponseEmitter
// Using zip as a gate. We don't let the preResponse from the preResponse emitter continue down the
// chain until and unless the jobRowStoredNotification emits an item.
.zipWith(jobRowStoredNotification, (preResponse, ignored) -> preResponse)
// Using zip as a gate. We don't let the preResponse from the preResponse emitter continue down the
// chain until and unless the preResponseStoredNotification emits an item.
.zipWith(preResponseStoredNotification, (preResponse, ignored) -> preResponse)
.map(PreResponse::getResponseContext)
.map(responseContext -> responseContext.containsKey(ResponseContextKeys.ERROR_MESSAGE.getName()))
Expand Down

0 comments on commit c762c4f

Please sign in to comment.