add dates to producer/consumer

This commit is contained in:
Emily
2024-12-03 17:40:47 +01:00
parent b630bddef0
commit 9ce2c89575
4 changed files with 71 additions and 7 deletions

View File

@@ -21,7 +21,9 @@ app.post('/event', express.json(jsonOptions), async (req, res) => {
const ip = getIPFromRequest(req);
const sessionHash = createSessionHash(req.body.website, ip, req.body.userAgent);
const flowHash = createFlowSessionHash(req.body.pid, ip, req.body.userAgent);
await RedisStreamService.addToStream(streamName, { ...req.body, _type: 'event', sessionHash, ip, flowHash });
await RedisStreamService.addToStream(streamName, {
...req.body, _type: 'event', sessionHash, ip, flowHash
});
return res.sendStatus(200);
} catch (ex: any) {
return res.status(500).json({ error: ex.message });