remove condition to delete refreshKeys

Signed-off-by: Kiss Miklos <miklos@roadie.io>
This commit is contained in:
Kiss Miklos
2022-08-29 10:59:55 +02:00
parent b3a1299b89
commit 67980a927a
@@ -145,22 +145,20 @@ export class DefaultProcessingDatabase implements ProcessingDatabase {
BATCH_SIZE,
);
if (refreshKeys && refreshKeys.length > 0) {
// Delete old refresh keys
await tx<DbRefreshKeysRow>('refresh_keys')
.where({ entity_id: id })
.delete();
// Delete old refresh keys
await tx<DbRefreshKeysRow>('refresh_keys')
.where({ entity_id: id })
.delete();
// Insert the refresh keys for the processed entity
await tx.batchInsert(
'refresh_keys',
refreshKeys.map(k => ({
entity_id: id,
key: k.key,
})),
BATCH_SIZE,
);
}
// Insert the refresh keys for the processed entity
await tx.batchInsert(
'refresh_keys',
refreshKeys.map(k => ({
entity_id: id,
key: k.key,
})),
BATCH_SIZE,
);
return {
previous: {