add STARTYCHUNK env

This commit is contained in:
BuckarooBanzay 2020-10-16 11:15:32 +02:00
parent cf3c2bc968
commit 6adf4adb8a
2 changed files with 6 additions and 1 deletions

View File

@ -33,6 +33,7 @@ services:
PGPASSWORD: enter
PGPORT: 5432
AREAS_FILE: /areas.dat
# STARTYCHUNK: -50
restart: "no"
volumes:

View File

@ -5,11 +5,15 @@ const bounds = require("./bounds");
async function worker() {
const ybounds = await bounds.find_y_bounds();
const minychunk = Math.floor((ybounds.miny + 2) / 5);
let minychunk = Math.floor((ybounds.miny + 2) / 5);
const maxychunk = Math.floor((ybounds.maxy + 2) / 5);
let chunkcount = 0;
let removecount = 0;
if (process.env.STARTYCHUNK) {
minychunk = +process.env.STARTYCHUNK;
}
for (let chunky = minychunk; chunky <= maxychunk; chunky++){
const miny = (chunky * 5) - 2;
const maxy = miny + 4;