后台:内存快照

This commit is contained in:
luying
2022-09-20 15:32:09 +08:00
parent a830ae040e
commit 2b687083de
12 changed files with 218 additions and 3 deletions

View File

@@ -135,4 +135,23 @@ export async function saveRebirthLog(session: any, hero: HeroType) {
} catch (e) {
console.error(e);
}
}
export async function saveMemoryLog(sid: string, memoryLogField: string, memoryData: string) {
try {
await UserLogModel.createRecord({ type: LOG_TYPE.MEMORY, sid, memoryLogField, memoryData });
} catch (e) {
console.error(e);
}
}
export async function saveMemoryLogs(sid: string, arr: { memoryLogField: string, memoryData: string} []) {
try {
let params = arr.map(({ memoryLogField, memoryData }) => {
return { type: LOG_TYPE.MEMORY, sid, memoryLogField, memoryData }
})
await UserLogModel.createRecords(params);
} catch (e) {
console.error(e);
}
}