diff options
author | Anton Tananaev <anton@traccar.org> | 2022-07-18 20:47:11 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-07-18 20:47:11 -0700 |
commit | c4509720c5dab9d7ba17dd6e89f0d846052b0c39 (patch) | |
tree | 73a14316d484ac6ed5137f44f1532350cee5382f /src/main/java/org/traccar/Main.java | |
parent | a61e08cb47b8294bf639ebdc0916ead031e92827 (diff) | |
download | trackermap-server-c4509720c5dab9d7ba17dd6e89f0d846052b0c39.tar.gz trackermap-server-c4509720c5dab9d7ba17dd6e89f0d846052b0c39.tar.bz2 trackermap-server-c4509720c5dab9d7ba17dd6e89f0d846052b0c39.zip |
Reset start on restart
Diffstat (limited to 'src/main/java/org/traccar/Main.java')
-rw-r--r-- | src/main/java/org/traccar/Main.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/Main.java b/src/main/java/org/traccar/Main.java index 6a968ac7e..e34fbb72a 100644 --- a/src/main/java/org/traccar/Main.java +++ b/src/main/java/org/traccar/Main.java @@ -20,8 +20,10 @@ import com.google.inject.Injector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.traccar.broadcast.BroadcastService; +import org.traccar.helper.model.DeviceUtil; import org.traccar.schedule.ScheduleManager; import org.traccar.storage.DatabaseModule; +import org.traccar.storage.Storage; import org.traccar.web.WebModule; import org.traccar.web.WebServer; @@ -120,6 +122,10 @@ public final class Main { LOGGER.info("Version: " + Main.class.getPackage().getImplementationVersion()); LOGGER.info("Starting server..."); + if (injector.getInstance(BroadcastService.class).singleInstance()) { + DeviceUtil.resetStatus(injector.getInstance(Storage.class)); + } + var services = Stream.of( ServerManager.class, WebServer.class, ScheduleManager.class, BroadcastService.class) .map(injector::getInstance) |