Skip to content

Commit

Permalink
added Hystrix.reset()
Browse files Browse the repository at this point in the history
  • Loading branch information
diegopacheco committed Dec 14, 2016
1 parent b4c8b1b commit 6c2c2cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.github.diegopacheco.dynomite.cluster.checker.util.ListJsonPrinter;
import com.google.common.collect.Lists;
import com.netflix.dyno.jedis.DynoJedisClient;
import com.netflix.hystrix.Hystrix;

/**
* This utility lass connects to a dynomite cluster and sends data to check if the replication is working.
Expand Down Expand Up @@ -144,6 +145,8 @@ private List<DynomiteNodeInfo> checkAllNodes(String clusterName,List<DynomiteNod
validNodes.add(node);
}catch(Exception e){
System.out.println("Could not Connet on Node: " + node + " EX: " + e);
}finally{
Hystrix.reset();
}
}
return validNodes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.apache.log4j.Logger;

import com.github.diegopacheco.dynomite.cluster.checker.hystrix.CommandDCC;
import com.netflix.hystrix.Hystrix;

@SuppressWarnings("serial")
public class RestServlet extends HttpServlet {
Expand All @@ -37,6 +38,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se
logger.error(e);
out.write("{ \"Error\": \"" + e.toString() + " - " + org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace(e) + "\" }");
}finally {
Hystrix.reset();
out.close();
}
}
Expand Down

0 comments on commit 6c2c2cd

Please sign in to comment.