Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

fix: when no dead icons, all icons are removed (#516)

Meier Lukas8e8f9081b029
diff --git a/apps/tasks/src/jobs/icons-updater.ts b/apps/tasks/src/jobs/icons-updater.ts
index abef72a7a..820b3602c 100644
--- a/apps/tasks/src/jobs/icons-updater.ts
+++ b/apps/tasks/src/jobs/icons-updater.ts
@@ -87,14 +87,15 @@ export const iconsUpdaterJob = createCronJob(EVERY_WEEK, {
if (newIcons.length >= 1) {
await transaction.insert(icons).values(newIcons);
}
- await transaction.delete(icons).where(
- deadIcons.length >= 1
- ? inArray(
- icons.checksum,
- deadIcons.map((icon) => icon.checksum),
- )
- : undefined,
- );
+ if (deadIcons.length >= 1) {
+ await transaction.delete(icons).where(
+ inArray(
+ icons.checksum,
+ deadIcons.map((icon) => icon.checksum),
+ ),
+ );
+ }
+
countDeleted += deadIcons.length;
});