Skip to content

Commit

Permalink
comm/iridium/IridiumManager: Tweak to extract variables from the pool…
Browse files Browse the repository at this point in the history
…ing runnable.
  • Loading branch information
paulosousadias committed Oct 7, 2024
1 parent 2834c5b commit 48e5a6f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/java/pt/lsts/neptus/comm/iridium/IridiumManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ public class IridiumManager {
private SimulatedMessenger simMessenger;
private ScheduledExecutorService service = null;
//private IridiumMessenger currentMessenger;


private Date lastCall;
private boolean running = false;

public static final int IRIDIUM_MTU = 270;
public static final int IRIDIUM_HEADER = 6;

Expand Down Expand Up @@ -102,11 +105,9 @@ public IridiumMessenger getCurrentMessenger() {
return simMessenger;
}
}

private Runnable pollMessages = new Runnable() {
Date lastTime = new Date(System.currentTimeMillis() - Duration.ofHours(1).toMillis());
Date lastCall;
boolean running = false;

@Override
public void run() {
Expand Down Expand Up @@ -195,6 +196,8 @@ public synchronized void start() {

ImcMsgManager.getManager().registerBusListener(this);
service = Executors.newScheduledThreadPool(1);
lastCall = null;
running = false;
service.scheduleAtFixedRate(pollMessages, 1, 2, TimeUnit.SECONDS);
}

Expand Down

0 comments on commit 48e5a6f

Please sign in to comment.