Commit ae4311c1 authored by Andre Freyssinet's avatar Andre Freyssinet

JORAM-377: Adds a task restarting the daemon if there is no message

during a period.
parent fad5af6d
......@@ -887,32 +887,14 @@ public class RestAcquisitionAsync implements AcquisitionDaemon {
}
private long round = 0;
public long getRound() {
return round;
}
private long lastActivity = 0;
public long getLastActivity() {
return lastActivity;
}
private long lastMessage = 0;
public long getLastMessage() {
return lastMessage;
}
private int nbCnx = 0;
public boolean isConnected() {
return uriCloseConsumer != null;
}
private int nbCnx = 0;
public int getNbCnx() {
return nbCnx;
}
/**
* Task checking the acquisition mechanism. If no message has been received during this
* period, the daemon is restarted.
......@@ -924,6 +906,10 @@ public class RestAcquisitionAsync implements AcquisitionDaemon {
public void run() {
if (checkTask == null) return;
if (logger.isLoggable(BasicLevel.INFO))
logger.log(BasicLevel.INFO,
"RestAcquisitionAsync.CheckTask.run(): cnx=" + nbCnx + ", msg=" + lastMessage + " (" + round + '/' + lastActivity + ')');
// TODO (AF): The check is currently done on the number of messages acquired. This involves
// restarting the daemon when there is no message for a period. There are other indicators,
// but the number of messages acquired is the most reliable.
......@@ -932,7 +918,7 @@ public class RestAcquisitionAsync implements AcquisitionDaemon {
return;
}
logger.log(BasicLevel.INFO, "RestAcquisitionAsync.CheckTask.run(): restart daemon.");
logger.log(BasicLevel.WARN, "RestAcquisitionAsync.CheckTask.run(): restart daemon.");
restart();
}
}
......
Markdown is supported
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