fix: history单独存

This commit is contained in:
ikechan8370 2025-03-26 12:08:40 +08:00
parent fcbdf51eb8
commit 4216e64ed6
2 changed files with 15 additions and 2 deletions

View file

@ -362,4 +362,17 @@ const ChatGPTStorage = new LowDBStorage({
directory: dataDir
})
if (ChatGPTStorage.db.data.collections.history) {
ChatGPTStorage.dropCollection('history').then(() => {
logger.debug('drop older version history collection')
}).catch(err => {
logger.warn('failed to drop older version history collection', err)
})
}
export const ChatGPTHistoryStorage = new LowDBStorage({
filename: 'history.json',
directory: dataDir
})
export default ChatGPTStorage