Skip to content

Instantly share code, notes, and snippets.

@qny31541
qny31541 / CooldownRestartPolicy.java
Created February 16, 2016 01:46 — forked from vladdu/CooldownRestartPolicy.java
Guava RestartableService
public class CooldownRestartPolicy extends ServiceRestartPolicy {
/**
* If restarting sooner than this, it's probably an unrecoverable error.
*/
public static final int RESTART_INTERVAL = 5000;
private long last;
private long interval = RESTART_INTERVAL;
public CooldownRestartPolicy() {