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