Skip to content
Snippets Groups Projects
Commit 362f9584 authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

fix caching for mining API

parent bdcf6fb6
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,7 @@ public class MiningApi { ...@@ -42,7 +42,7 @@ public class MiningApi {
@ApiOperation(value = "Run an algorithm", response = String.class) @ApiOperation(value = "Run an algorithm", response = String.class)
@Cacheable(value = "mining", condition = "#query.getAlgorithm().getCode() == 'histograms'", key = "#query.toString()") @Cacheable(value = "mining", condition = "#query.getAlgorithm().getCode() == 'histograms'", key = "#query.toString()", unless = "#result.getStatusCode().value()!=200")
@RequestMapping(method = RequestMethod.POST) @RequestMapping(method = RequestMethod.POST)
public ResponseEntity runAlgorithm(@RequestBody eu.hbp.mip.model.MiningQuery query) throws IOException { public ResponseEntity runAlgorithm(@RequestBody eu.hbp.mip.model.MiningQuery query) throws IOException {
LOGGER.info("Run an algorithm"); LOGGER.info("Run an algorithm");
...@@ -50,7 +50,7 @@ public class MiningApi { ...@@ -50,7 +50,7 @@ public class MiningApi {
LOGGER.info("Akka is trying to reach remote " + wokenRefPath); LOGGER.info("Akka is trying to reach remote " + wokenRefPath);
ActorSelection wokenActor = actorSystem.actorSelection(wokenRefPath); ActorSelection wokenActor = actorSystem.actorSelection(wokenRefPath);
Timeout timeout = new Timeout(Duration.create(10, "seconds")); Timeout timeout = new Timeout(Duration.create(120, "seconds"));
Future<Object> future = Patterns.ask(wokenActor, query.prepareQuery(), timeout); Future<Object> future = Patterns.ask(wokenActor, query.prepareQuery(), timeout);
QueryResult result; QueryResult result;
try { try {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment