Compare commits
No commits in common. "e104fae66fedb2a6c86123c17a89776417ecc74c" and "5aa1b409f2248def49adae1da180f641e5fe7924" have entirely different histories.
e104fae66f
...
5aa1b409f2
@ -23,14 +23,15 @@ public class DataStoreBot {
|
||||
}
|
||||
public void setInterval(int seconds) {
|
||||
ScheduledExecutorService ses = Executors.newScheduledThreadPool(1);
|
||||
ses.scheduleAtFixedRate(()->{
|
||||
ses.schedule(()->{
|
||||
try {
|
||||
this.setInterval(seconds);
|
||||
this.storeLatestEntry();
|
||||
} catch (IOException | ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}, 0, seconds, TimeUnit.SECONDS);
|
||||
//ses.shutdown();
|
||||
}, seconds, TimeUnit.SECONDS);
|
||||
ses.shutdown();
|
||||
}
|
||||
public Runnable storeLatestEntry() throws IOException, ParseException {
|
||||
JSONArray APIData = this.api.getJSONObject();
|
||||
|
Loading…
Reference in New Issue
Block a user