configurable max blocks

master
Thomas Rudin 2018-07-02 10:31:25 +02:00
parent a044fcd168
commit 4aa89abea5
2 changed files with 8 additions and 1 deletions

View File

@ -29,6 +29,10 @@ public interface TileServerConfig extends Config {
@DefaultValue("20")
int tilerendererUpdateInterval();
@Key("tilerenderer.maxupdateblocks")
@DefaultValue("500")
int tilerendererUpdateMaxBlocks();
@Key("player.updateinterval")
@DefaultValue("2")
int playerUpdateInterval();

View File

@ -37,8 +37,11 @@ public class UpdateChangedTilesJob implements Runnable {
this.eventBus = eventBus;
this.yCondition = BLOCKS.POSY.between(cfg.tilesMinY(), cfg.tilesMaxY());
this.cfg = cfg;
}
private final TileServerConfig cfg;
private final EventBus eventBus;
private final DSLContext ctx, tileCtx;
@ -84,7 +87,7 @@ public class UpdateChangedTilesJob implements Runnable {
try {
running = true;
final int LIMIT = 500;
final int LIMIT = cfg.tilerendererUpdateMaxBlocks();
Result<BlocksRecord> blocks = ctx
.selectFrom(BLOCKS)