add run time in version info

This commit is contained in:
heavyrain2012
2021-09-20 21:01:40 +08:00
parent f39fd3abd5
commit 4fd87eb605
2 changed files with 11 additions and 3 deletions
@@ -8,6 +8,8 @@
package win.liyufan.im;
import io.moquette.server.Server;
import java.io.*;
import java.util.Properties;
@@ -34,10 +36,8 @@ public class GitRepositoryState {
public final String buildTime;
public final String buildHost;
public final String buildVersion;
public final long runTime;
private final static long startTime = System.currentTimeMillis();
private GitRepositoryState(Properties properties) {
this.tags = String.valueOf(properties.get("git.tags"));
@@ -62,7 +62,7 @@ public class GitRepositoryState {
this.buildTime = String.valueOf(properties.get("git.build.time"));
this.buildHost = String.valueOf(properties.get("git.build.host"));
this.buildVersion = String.valueOf(properties.get("git.build.version"));
this.runTime = (System.currentTimeMillis() - startTime)/1000;
this.runTime = Server.getServer().getRunTime();
}
public static GitRepositoryState getGitRepositoryState() throws IOException {