fix: when no dead icons, all icons are removed (#516)
This commit is contained in:
@@ -87,14 +87,15 @@ export const iconsUpdaterJob = createCronJob(EVERY_WEEK, {
|
|||||||
if (newIcons.length >= 1) {
|
if (newIcons.length >= 1) {
|
||||||
await transaction.insert(icons).values(newIcons);
|
await transaction.insert(icons).values(newIcons);
|
||||||
}
|
}
|
||||||
await transaction.delete(icons).where(
|
if (deadIcons.length >= 1) {
|
||||||
deadIcons.length >= 1
|
await transaction.delete(icons).where(
|
||||||
? inArray(
|
inArray(
|
||||||
icons.checksum,
|
icons.checksum,
|
||||||
deadIcons.map((icon) => icon.checksum),
|
deadIcons.map((icon) => icon.checksum),
|
||||||
)
|
),
|
||||||
: undefined,
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
countDeleted += deadIcons.length;
|
countDeleted += deadIcons.length;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user