updatePNI: Cleanup only for obsolete PNI
This commit is contained in:
parent
a72a431e0f
commit
f366454893
6 changed files with 132 additions and 45 deletions
|
@ -200,6 +200,7 @@ const dataInterface: ServerInterface = {
|
|||
bulkAddSessions,
|
||||
removeSessionById,
|
||||
removeSessionsByConversation,
|
||||
removeSessionsByUUID,
|
||||
removeAllSessions,
|
||||
getAllSessions,
|
||||
|
||||
|
@ -1308,6 +1309,17 @@ async function removeSessionsByConversation(
|
|||
conversationId,
|
||||
});
|
||||
}
|
||||
async function removeSessionsByUUID(uuid: UUIDStringType): Promise<void> {
|
||||
const db = getInstance();
|
||||
db.prepare<Query>(
|
||||
`
|
||||
DELETE FROM sessions
|
||||
WHERE uuid = $uuid;
|
||||
`
|
||||
).run({
|
||||
uuid,
|
||||
});
|
||||
}
|
||||
async function removeAllSessions(): Promise<void> {
|
||||
return removeAllFromTable(getInstance(), SESSIONS_TABLE);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue