use path.resolve for parsing path strings
This commit is contained in:
parent
f62c5e0474
commit
33a1ca1c97
|
@ -2,6 +2,7 @@
|
|||
* creation of captchas
|
||||
*/
|
||||
|
||||
import path from 'path';
|
||||
import { Worker } from 'worker_threads';
|
||||
|
||||
import logger from './logger';
|
||||
|
@ -11,7 +12,7 @@ const MAX_WAIT = 30 * 1000;
|
|||
/*
|
||||
* worker thread
|
||||
*/
|
||||
const worker = new Worker('./workers/captchaloader.js');
|
||||
const worker = new Worker(path.resolve('./workers/captchaloader.js'));
|
||||
|
||||
/*
|
||||
* queue of captcha-generation tasks
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { Worker } from 'worker_threads';
|
||||
|
||||
import logger from './logger';
|
||||
|
@ -23,7 +24,7 @@ const CanvasUpdaters = {};
|
|||
/*
|
||||
* worker thread
|
||||
*/
|
||||
const worker = new Worker('./workers/tilewriter.js');
|
||||
const worker = new Worker(path.resolve('./workers/tilewriter.js'));
|
||||
|
||||
/*
|
||||
* queue of tasks that is worked on in FIFO
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* REDIS_URL can be url or path to unix socket
|
||||
*/
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { createClient, defineScript } from 'redis';
|
||||
import { isMainThread } from 'worker_threads';
|
||||
|
||||
|
@ -11,7 +12,7 @@ import { REDIS_URL, SHARD_NAME } from '../../core/config';
|
|||
const scripts = {
|
||||
placePxl: defineScript({
|
||||
NUMBER_OF_KEYS: 9,
|
||||
SCRIPT: fs.readFileSync('./workers/lua/placePixel.lua'),
|
||||
SCRIPT: fs.readFileSync(path.resolve('./workers/lua/placePixel.lua')),
|
||||
transformArguments(...args) {
|
||||
return args.map((a) => ((typeof a === 'string') ? a : a.toString()));
|
||||
},
|
||||
|
@ -19,7 +20,7 @@ const scripts = {
|
|||
}),
|
||||
allowedChat: defineScript({
|
||||
NUMBER_OF_KEYS: 3,
|
||||
SCRIPT: fs.readFileSync('./workers/lua/allowedChat.lua'),
|
||||
SCRIPT: fs.readFileSync(path.resolve('./workers/lua/allowedChat.lua')),
|
||||
transformArguments(...args) {
|
||||
return args.map((a) => ((typeof a === 'string') ? a : a.toString()));
|
||||
},
|
||||
|
@ -27,7 +28,7 @@ const scripts = {
|
|||
}),
|
||||
getUserRanks: defineScript({
|
||||
NUMBER_OF_KEYS: 2,
|
||||
SCRIPT: fs.readFileSync('./workers/lua/getUserRanks.lua'),
|
||||
SCRIPT: fs.readFileSync(path.resolve('./workers/lua/getUserRanks.lua')),
|
||||
transformArguments(...args) {
|
||||
return args.map((a) => ((typeof a === 'string') ? a : a.toString()));
|
||||
},
|
||||
|
@ -35,7 +36,7 @@ const scripts = {
|
|||
}),
|
||||
zmRankRev: defineScript({
|
||||
NUMBER_OF_KEYS: 1,
|
||||
SCRIPT: fs.readFileSync('./workers/lua/zmRankRev.lua'),
|
||||
SCRIPT: fs.readFileSync(path.resolve('./workers/lua/zmRankRev.lua')),
|
||||
transformArguments(key, uids) {
|
||||
return [
|
||||
key,
|
||||
|
|
|
@ -21,12 +21,13 @@ const basePackageValues = {
|
|||
private: true,
|
||||
engines: pkg.engines,
|
||||
scripts: {
|
||||
start: 'node --nouse-idle-notification --expose-gc server.js',
|
||||
start: 'pm2 restart ecosystem.yml',
|
||||
},
|
||||
dependencies: {
|
||||
mysql2: '',
|
||||
'utf-8-validate': '',
|
||||
bufferutil: '',
|
||||
pm2: '^5.3.0',
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user