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) {
|
public void setInterval(int seconds) {
|
||||||
ScheduledExecutorService ses = Executors.newScheduledThreadPool(1);
|
ScheduledExecutorService ses = Executors.newScheduledThreadPool(1);
|
||||||
ses.scheduleAtFixedRate(()->{
|
ses.schedule(()->{
|
||||||
try {
|
try {
|
||||||
|
this.setInterval(seconds);
|
||||||
this.storeLatestEntry();
|
this.storeLatestEntry();
|
||||||
} catch (IOException | ParseException e) {
|
} catch (IOException | ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}, 0, seconds, TimeUnit.SECONDS);
|
}, seconds, TimeUnit.SECONDS);
|
||||||
//ses.shutdown();
|
ses.shutdown();
|
||||||
}
|
}
|
||||||
public Runnable storeLatestEntry() throws IOException, ParseException {
|
public Runnable storeLatestEntry() throws IOException, ParseException {
|
||||||
JSONArray APIData = this.api.getJSONObject();
|
JSONArray APIData = this.api.getJSONObject();
|
||||||
|
Loading…
Reference in New Issue
Block a user