This commit is contained in:
genuineparts 2024-10-29 13:09:28 +01:00
parent 24c4e622e1
commit 5565fd2201
2 changed files with 32 additions and 30 deletions

View file

@ -11,14 +11,12 @@ import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.util.Collections;
import java.util.HashMap;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class Main {
private static final HashMap<String, Integer> data = new HashMap<String, Integer>();
private static final HashMap<String, Integer> data = new HashMap<>();
static OebbCheck check = new OebbCheck();
public static void main(String[] args) throws IOException {
@ -28,14 +26,11 @@ public class Main {
server.setExecutor(null); // creates a default executor
server.start();
Runnable task = new Runnable() {
@Override
public void run() {
try {
refresh();
} catch (IOException e) {
throw new RuntimeException(e);
}
Runnable task = () -> {
try {
refresh();
} catch (IOException e) {
throw new RuntimeException(e);
}
};
try (ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor()) {