diff --git a/plugins/genshin/model/mys/mysInfo.js b/plugins/genshin/model/mys/mysInfo.js index e3bb190..b41f3b0 100644 --- a/plugins/genshin/model/mys/mysInfo.js +++ b/plugins/genshin/model/mys/mysInfo.js @@ -259,24 +259,22 @@ export default class MysInfo { */ static async initCache (force = false, clearData = false) { // 检查缓存标记 - let cache = DailyCache.create() - if (!force && await cache.get('cache-ready')) { + const cache = DailyCache.create() + if (!force && await cache.get('cache-ready') || this.initing) return true - } + this.initing = true await DailyCache.clearOutdatedData() - if (clearData) { + if (clearData) await MysUser.clearCache() - } // 先初始化用户CK,减少一些公共CK中ltuid无法识别的情况 await MysInfo.initUserCk() - - await cache.set('cache-ready', new Date() * 1) - // 初始化公共ck await MysInfo.initPubCk() + await cache.set('cache-ready', new Date() * 1) + delete this.initing return true } @@ -462,4 +460,4 @@ export default class MysInfo { /** 统计次数设为超限 */ await this.ckUser.disable(game) } -} +} \ No newline at end of file