mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-03 15:08:12 +01:00
parent
2517c0416d
commit
8175e599ec
@ -84,10 +84,11 @@ public class ExportScheduler extends PluginRunnable {
|
||||
}
|
||||
|
||||
private void schedulePlayersPageExport() {
|
||||
long period = TimeAmount.toTicks(config.get(ExportSettings.EXPORT_PERIOD), TimeUnit.MILLISECONDS);
|
||||
long period = TimeAmount.toTicks(config.get(ExportSettings.EXPORT_PERIOD), TimeUnit.MILLISECONDS)
|
||||
/ 4;
|
||||
runnableFactory.create(
|
||||
new ExportTask(exporter, Exporter::exportPlayersPage, errorLogger)
|
||||
).runTaskTimerAsynchronously(0L, period);
|
||||
).runTaskTimerAsynchronously(TimeAmount.toTicks(2, TimeUnit.MINUTES), period);
|
||||
}
|
||||
|
||||
private void scheduleServerPageExport() {
|
||||
@ -103,7 +104,7 @@ public class ExportScheduler extends PluginRunnable {
|
||||
Optional<Server> proxy = servers.stream().filter(Server::isProxy).findFirst();
|
||||
proxy.ifPresent(mainServer -> runnableFactory.create(
|
||||
new ExportTask(exporter, same -> same.exportServerPage(mainServer), errorLogger))
|
||||
.runTaskTimerAsynchronously(0L, period)
|
||||
.runTaskTimerAsynchronously(TimeAmount.toTicks(1, TimeUnit.MINUTES), period)
|
||||
);
|
||||
|
||||
int offsetMultiplier = proxy.isPresent() ? 1 : 0; // Delay first server export if on a network.
|
||||
|
@ -20,20 +20,24 @@ import com.djrapitops.plan.exceptions.ExceptionWithContext;
|
||||
|
||||
public interface ErrorLogger {
|
||||
default <T extends ExceptionWithContext> void critical(T throwable) {
|
||||
critical((Throwable) throwable, throwable.getContext().orElse(ErrorContext.builder().related("Missing Context").build()));
|
||||
critical((Throwable) throwable, throwable.getContext().orElseGet(this::createMissingContext));
|
||||
}
|
||||
|
||||
void critical(Throwable throwable, ErrorContext context);
|
||||
|
||||
default <T extends ExceptionWithContext> void error(T throwable) {
|
||||
error((Throwable) throwable, throwable.getContext().orElse(ErrorContext.builder().related("Missing Context").build()));
|
||||
error((Throwable) throwable, throwable.getContext().orElseGet(this::createMissingContext));
|
||||
}
|
||||
|
||||
void error(Throwable throwable, ErrorContext context);
|
||||
|
||||
default <T extends ExceptionWithContext> void warn(T throwable) {
|
||||
warn((Throwable) throwable, throwable.getContext().orElse(ErrorContext.builder().related("Missing Context").build()));
|
||||
warn((Throwable) throwable, throwable.getContext().orElseGet(this::createMissingContext));
|
||||
}
|
||||
|
||||
void warn(Throwable throwable, ErrorContext context);
|
||||
|
||||
default ErrorContext createMissingContext() {
|
||||
return ErrorContext.builder().related("Missing Context").build();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user