diff --git a/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java b/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java index 23ce7d84..937498b8 100644 --- a/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java +++ b/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java @@ -437,11 +437,14 @@ public class MpMasterService extends Service { if (mPreviousMpHbTime <= ts && ts - mPreviousMpHbTime > mMpHeartbeatDuration * 2) { // MpApp is not running - if (ts - mTimeToStartMpApp >= 30000) { + if (ts - mTimeToStartMpApp >= 1800000) { MicroPhotoContext.restartMpApp(context, "MpMST Keep Alive Detection"); - mTimeToStartMpApp = ts; + logger.warning("Restart MpAPP as it is NOT Running Prev MPAPP HB=" + - Long.toString((ts - mPreviousMpHbTime) / 1000) + " MPAPP HBDuration=" + Long.toString(mMpHeartbeatDuration)); + Long.toString((ts - mPreviousMpHbTime) / 1000) + " MPAPP HBDuration=" + Long.toString(mMpHeartbeatDuration) + + " Prev MpRestart Time=" + Long.toString(mTimeToStartMpApp)); + + mTimeToStartMpApp = ts; } else { logger.warning("MpAPP has restarted during 30s, skip the check."); } @@ -459,7 +462,7 @@ public class MpMasterService extends Service { ((ts - modifiedTimeOfPhoto) > mTimeOfMpAppAlive * 4) || ((ts - modifiedTimeOfUpload) > mTimeOfMpAppAlive * 4)) { - if (ts - mTimeToStartMpApp >= 30000) { + if (ts - mTimeToStartMpApp >= 1800000) { String msg = "Restart MpAPP as it is NOT Running hb=" + Long.toString(ts - modifiedTimeOfHb) + " taking=" + Long.toString(ts - modifiedTimeOfPhoto) + " sending=" + Long.toString(ts - modifiedTimeOfUpload) + " Will restart MpApp in " + Long.toString(mDelayedRestartMpTime / 1000) + " seconds";