Skip to content

Commit

Permalink
fix: moved requires around to fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Aug 12, 2022
1 parent 5da0cfe commit 6ea1cef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/components/playerController/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { dir, log, logOk, logWarn, logError } = require('../../extras/console')(m
// eslint-disable-next-line no-unused-vars
const { SAVE_PRIORITY_LOW, SAVE_PRIORITY_MEDIUM, SAVE_PRIORITY_HIGH, Database } = require('./database.js');
const idGen = require('./idGenerator.js');

const PlayerlistGenerator = require('./playerlistGenerator.js');

//Helpers
const now = () => { return Math.round(Date.now() / 1000); };
Expand Down Expand Up @@ -70,7 +70,6 @@ module.exports = class PlayerController {

//Running playerlist generator
if (GlobalData.isDeveloperMode && GlobalData.debugPlayerlistGenerator) {
const PlayerlistGenerator = require('./playerlistGenerator.js');
this.playerlistGenerator = new PlayerlistGenerator();
}

Expand Down
5 changes: 4 additions & 1 deletion src/components/playerController/playerlistGenerator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//Requires
const modulename = 'PlayerlistGenerator';
const fs = require('node:fs');
const { dir, log, logOk, logWarn, logError } = require('../../extras/console')(modulename);
const got = require('../../extras/got');

Expand All @@ -19,8 +20,10 @@ const unDups = (arr) => arr.filter((v, i) => arr.indexOf(v) === i);
module.exports = class PlayerlistGenerator {
constructor() {
//Configs
const srcPath = './src/components/playerController/playerlist.ignore.json';
this.config = {
srcPlayerlist: require('./playerlist.ignore.json'),
// srcPlayerlist: require('./playerlist.ignore.json'),
srcPlayerlist: JSON.parse(fs.readFileSync(srcPath)),
// refreshInterval: 2*60*1000,
refreshInterval: 10 * 1000,
shouldAddRemovePlayers: true,
Expand Down

0 comments on commit 6ea1cef

Please sign in to comment.