From 9ebbe19c4f99f24935ae9a1edf5d6ff83d4ee71b Mon Sep 17 00:00:00 2001 From: Matthew Date: Sat, 30 Nov 2024 10:00:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=90=AFMpAPP?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E9=97=B4=E9=9A=94=E6=97=B6=E9=97=B4=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xypower/mpmaster/MpMasterService.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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";