mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-13 19:50:35 +00:00
Update db.ts
通过读取缓存修复刚说话缺无法获取发言时间的问题
This commit is contained in:
parent
eb84e2f8c9
commit
a9f3e7fc54
@ -408,10 +408,12 @@ class DBUtil extends DBUtilBase {
|
|||||||
logDebug('读取发言时间', groupId);
|
logDebug('读取发言时间', groupId);
|
||||||
return new Promise<IRember[]>((resolve, reject) => {
|
return new Promise<IRember[]>((resolve, reject) => {
|
||||||
this.db!.all(`SELECT * FROM "${groupId}" `, (err, rows: IRember[]) => {
|
this.db!.all(`SELECT * FROM "${groupId}" `, (err, rows: IRember[]) => {
|
||||||
|
const cache = this.LURCache.get(groupId).map(e=>({user_id:e.userId, last_sent_time:e.value}));
|
||||||
if (err) {
|
if (err) {
|
||||||
logError('查询发言时间失败', groupId);
|
logError('查询发言时间失败', groupId);
|
||||||
return resolve([]);
|
return resolve(cache.map(e=>({...e, join_time:0})));
|
||||||
}
|
}
|
||||||
|
Object.assign(rows, cache)
|
||||||
logDebug('查询发言时间成功', groupId, rows);
|
logDebug('查询发言时间成功', groupId, rows);
|
||||||
resolve(rows);
|
resolve(rows);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user