Skip to content

Commit

Permalink
fix: dont sAdd if array.length === 0 (#3559)
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Fontanier <[email protected]>
  • Loading branch information
fontanierh and Henry Fontanier authored Feb 2, 2024
1 parent 5eb0b3e commit 3884a27
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions connectors/src/connectors/notion/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,12 @@ export async function garbageCollectorMarkAsSeen({
const redisCli = await redisClient();
try {
const redisKey = redisGarbageCollectorKey(connector.id);
await redisCli.sAdd(`${redisKey}-pages`, pageIds);
await redisCli.sAdd(`${redisKey}-databases`, databaseIds);
if (pageIds.length > 0) {
await redisCli.sAdd(`${redisKey}-pages`, pageIds);
}
if (databaseIds.length > 0) {
await redisCli.sAdd(`${redisKey}-databases`, databaseIds);
}
} finally {
await redisCli.quit();
}
Expand Down

0 comments on commit 3884a27

Please sign in to comment.