在临时停服执行脚本时,可以使用这个方案
This commit is contained in:
xcy 2023-12-20 15:19:45 +08:00
parent 7e24671983
commit fb7684326e

View File

@ -98,6 +98,15 @@ function setWs(server: WsServer<ServiceType>) {
//执行 API 接口实现之前 //执行 API 接口实现之前
server.flows.preApiCallFlow.push(async call => { server.flows.preApiCallFlow.push(async call => {
// 临时停服维护方案
// let lng = {
// "zh-TW": "停服維護中,請等待!",
// "ko": "서버 점검 중, 잠시만 기다려 주세요.",
// "ja": "サーバーメンテナンス中、しばらくお待ちください。",
// "en": "Server under maintenance. Please wait.",
// }
// call.error("", {code: -1, message: lng[call.req.lng] || lng["ja"]})
// return null;
//是否短时间内重复请求某个api //是否短时间内重复请求某个api
// let timeIntervalLimit = call.service.conf?.timeIntervalLimit == undefined ? 500 : call.service.conf?.timeIntervalLimit; // let timeIntervalLimit = call.service.conf?.timeIntervalLimit == undefined ? 500 : call.service.conf?.timeIntervalLimit;