mirror of
https://github.com/Dark98/SliceBeam.git
synced 2026-12-06 06:27:16 +00:00
Optimize boot time
This commit is contained in:
1 parent
6092f123b5
commit
662018834e
14 files changed
+337
-41
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package ru.ytkab0bp.slicebeam.boot;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import ru.ytkab0bp.slicebeam.BeamServerData;
|
||||
import ru.ytkab0bp.slicebeam.SliceBeam;
|
||||
import ru.ytkab0bp.slicebeam.utils.Prefs;
|
||||
|
||||
public class BeamServerDataTask extends BootTask {
|
||||
public BeamServerDataTask() {
|
||||
super(() -> {
|
||||
try {
|
||||
SliceBeam.SERVER_DATA = new BeamServerData(new JSONObject(Prefs.getBeamServerData()));
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (System.currentTimeMillis() - Prefs.getLastCheckedInfo() >= 86400000L) {
|
||||
BeamServerData.load();
|
||||
}
|
||||
});
|
||||
onWorker();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user