Skip to content

Commit

Permalink
Fixed #3389. turn off refresh rails data for differential push (#3390)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobi7 authored Aug 14, 2019
1 parent cd68c55 commit 88fadeb
Showing 1 changed file with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,23 +422,25 @@ public Response differentialPush(@Context HttpServletRequest request,
String grandparentJobId = DbUtils.getParentId(reqParams.getParentId());
Long resourceId = DbUtils.getMapIdByJobId(grandparentJobId); // the merged layer

// Setup workflow to refresh rails data after the push
long referenceId = DbUtils.getMergedReference(resourceId);
Map<String, String> mapTags = DbUtils.getMapsTableTags(referenceId);

GrailParams refreshParams = new GrailParams();
refreshParams.setUser(user);
refreshParams.setWorkDir(workDir);
refreshParams.setOutput(DbUtils.getDisplayNameById(referenceId));
refreshParams.setBounds(mapTags.get("bbox"));
refreshParams.setParentId("grail_" + mapTags.get("bbox").replace(",", "_"));

try {
List<Command> refreshWorkflow = setupRailsPull(jobId, refreshParams);
workflow.addAll(refreshWorkflow);
}
catch(UnavailableException exc) {
return Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(exc.getMessage()).build();
if(resourceId != null) {
// Setup workflow to refresh rails data after the push
long referenceId = DbUtils.getMergedReference(resourceId);
Map<String, String> mapTags = DbUtils.getMapsTableTags(referenceId);

GrailParams refreshParams = new GrailParams();
refreshParams.setUser(user);
refreshParams.setWorkDir(workDir);
refreshParams.setOutput(DbUtils.getDisplayNameById(referenceId));
refreshParams.setBounds(mapTags.get("bbox"));
refreshParams.setParentId("grail_" + mapTags.get("bbox").replace(",", "_"));

try {
List<Command> refreshWorkflow = setupRailsPull(jobId, refreshParams);
workflow.addAll(refreshWorkflow);
}
catch(UnavailableException exc) {
return Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(exc.getMessage()).build();
}
}

jobProcessor.submitAsync(new Job(jobId, user.getId(), workflow.toArray(new Command[workflow.size()]), JobType.UPLOAD_CHANGESET, reqParams.getParentId()));
Expand Down

0 comments on commit 88fadeb

Please sign in to comment.