Skip to content

Commit

Permalink
Update luma.js
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed Nov 27, 2024
1 parent 9cad99b commit 0b6051c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/src/controllers/luma.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ export const createEvent = async (req, res, next) => {

let payload = cleanPayload(req.body);
// Check for duplicate events
const key = `processed_event:${payload.title}_${payload.start_time}`;
const exists = await redis.get(key);
const member = `${payload.title}_${payload.start_time}`;
const exists = await redis.hget(`processed_events`, member);
if (exists) {
return res.status(200).json({ status: 'rejected', message: 'Duplicate event, skipped processing' });
}
await redis.set(key, 'true');
console.log(payload)
await redis.hset(`processed_events`, member, '1');

const event = await composeDBService.createNode({
...payload,
});
Expand Down

0 comments on commit 0b6051c

Please sign in to comment.