运维日志如果6小时未更新,则重启运维

nx2024
Matthew 2 months ago
parent 8a9813ff25
commit 6d32fdf087

@ -406,8 +406,8 @@ public class MicroPhotoService extends Service {
try {
File mpmstLogFile = new File(MicroPhotoContext.buildMasterAppDir(context) + "logs/mlog.txt");
long mlogTime = mpmstLogFile.exists() ? mpmstLogFile.lastModified() : 0;
if ((ts - mlogTime) > 1800000 /*86400000*/) {
// More than 1 day, try restart it
if ((ts - mlogTime) > 21600000) {
// More than 6 hours, try restart it
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPMASTER);
if (launchIntent != null) {
launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);

Loading…
Cancel
Save