✨ feat(线上维护): json线上更新方案
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Application, ChannelService, HandlerService, } from 'pinus';
|
||||
import { reloadResources } from '../../../pubUtils/data';
|
||||
import { gameData, reloadResources } from '../../../pubUtils/data';
|
||||
import { refundOrderFromRedisPub, settleOrderFromRedisPub } from '../../../services/orderService';
|
||||
import { getServerMainten, setServerMainten, stopServerMainten } from '../../../services/gmService';
|
||||
import { taflush } from '../../../services/sdkService';
|
||||
@@ -7,6 +7,7 @@ import { errlogger } from '../../../util/logger';
|
||||
import { setApiIsClose } from '../../../services/chatService';
|
||||
import { setKvToMemory } from '../../../services/pushService';
|
||||
import { setHiddenData } from '../../../services/memoryCache/hiddenData';
|
||||
import * as dicParam from '../../../pubUtils/dicParam';
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -25,14 +26,31 @@ export class OrderRemote {
|
||||
/**
|
||||
* 重载json资源
|
||||
*/
|
||||
public async reloadResources() {
|
||||
public async reloadResources(type?: string) {
|
||||
try {
|
||||
reloadResources();
|
||||
reloadResources(type);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async setDicParam(field1: string, field2: string, value: string|number) {
|
||||
try {
|
||||
if(dicParam[field1] && dicParam[field1][field2]) dicParam[field1][field2] = value;
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async setGameDataToApp() {
|
||||
try {
|
||||
this.app.set('gameData', gameData);
|
||||
this.app.set('dicParam', dicParam);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async settleOrderFromRedisPub(message: string) {
|
||||
try {
|
||||
await settleOrderFromRedisPub(message);
|
||||
@@ -104,4 +122,12 @@ export class OrderRemote {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async fun() {
|
||||
try {
|
||||
console.log('预留一个函数,用于之后线上维护时需要使用');
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user