File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
backend/src/main/java/com/park/utmstack Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 99import javax .validation .constraints .NotNull ;
1010import javax .validation .constraints .Size ;
1111import java .io .Serializable ;
12+ import java .time .Instant ;
1213import java .util .Objects ;
1314import java .util .concurrent .TimeUnit ;
1415
@@ -64,8 +65,8 @@ public class UtmDataInputStatus implements Serializable {
6465 */
6566 public Boolean isDown () {
6667 if (Objects .isNull (timestamp ) || Objects .isNull (median ))
67- return null ;
68- long currentTimeInSeconds = TimeUnit . MILLISECONDS . toSeconds ( System . currentTimeMillis () );
69- return (currentTimeInSeconds - timestamp ) > (median * 6 );
68+ return false ;
69+ long now = Instant . now (). getEpochSecond ( );
70+ return (now - timestamp ) > (median * 1.5 );
7071 }
7172}
Original file line number Diff line number Diff line change @@ -202,7 +202,9 @@ public void syncDataInputStatus() {
202202
203203 UtmDataInputStatus dataInputStatus = existingOpt
204204 .map (existing -> {
205- existing .setTimestamp (timestamp );
205+ if (timestamp != existing .getTimestamp ()) {
206+ existing .setTimestamp (timestamp );
207+ }
206208 return existing ;
207209 })
208210 .orElseGet (() -> UtmDataInputStatus .builder ()
You can’t perform that action at this time.
0 commit comments