1
0
Fork 0
mirror of https://github.com/xHyroM/lighteco.git synced 2024-11-10 01:18:07 +01:00

feat: saveInternal in config

This commit is contained in:
Jozef Steinhübl 2023-08-30 00:48:38 +02:00
parent 63dc921539
commit 0c35ff18b0
3 changed files with 4 additions and 12 deletions

View file

@ -17,6 +17,9 @@ public class Config extends OkaeriConfig {
@Comment("Storage settings.")
public StorageConfig storage = new StorageConfig();
@Comment("Save interval to storage in seconds.")
public long saveInterval = 5L;
@Comment("Messages")
public MessageConfig messages = new MessageConfig();
}

View file

@ -1,13 +1,9 @@
package dev.xhyrom.lighteco.common.model.currency;
import dev.xhyrom.lighteco.common.model.user.User;
import dev.xhyrom.lighteco.common.plugin.LightEcoPlugin;
import lombok.Getter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class Currency {
private final LightEcoPlugin plugin;
@ -39,11 +35,4 @@ public class Currency {
public int fractionalDigits() {
return proxy.fractionalDigits();
}
public List<User> getTopUsers(int length) {
List<User> users = new ArrayList<>();
users.add(new User(plugin, new UUID(0, 0)));
return users;
}
}

View file

@ -55,7 +55,7 @@ public abstract class AbstractLightEcoPlugin implements LightEcoPlugin {
LightEcoProvider.set(this.api);
this.registerApiOnPlatform(this.api);
this.getBootstrap().getScheduler().asyncRepeating(new UserSaveTask(this), 3, TimeUnit.SECONDS);
this.getBootstrap().getScheduler().asyncRepeating(new UserSaveTask(this), this.config.saveInterval, TimeUnit.SECONDS);
}
public final void disable() {