Add CallLinkDeleteManager to retry and ensure deletion

This commit is contained in:
ayumi-signal 2024-09-16 12:22:01 -07:00 committed by GitHub
parent 8b627b3f1a
commit a40d54099c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 229 additions and 89 deletions

View file

@ -305,16 +305,13 @@ export function getAllCallLinkRecordsWithAdminKey(
.map(item => callLinkRecordSchema.parse(item));
}
export function getAllMarkedDeletedCallLinks(
export function getAllMarkedDeletedCallLinkRoomIds(
db: ReadableDB
): ReadonlyArray<CallLinkType> {
): ReadonlyArray<string> {
const [query] = sql`
SELECT * FROM callLinks WHERE deleted = 1;
SELECT roomId FROM callLinks WHERE deleted = 1;
`;
return db
.prepare(query)
.all()
.map(item => callLinkFromRecord(callLinkRecordSchema.parse(item)));
return db.prepare(query).pluck().all();
}
// TODO: Run this after uploading storage records, maybe periodically on startup