feat: add autocannon and fix purchase ticket flow

This commit is contained in:
Ayobami
2025-07-30 22:31:34 +01:00
parent 42fec5708a
commit 064ae104f7
6 changed files with 173 additions and 103 deletions
+4 -3
View File
@@ -32,13 +32,14 @@ redis.call('HINCRBY', globalKey, 'totalSold', 1)
-- Store purchase record
local purchaseKey = 'purchase:' .. purchaseId
redis.call('HSET', purchaseKey, {
local eventIdFromKey = string.match(ticketKey, 'event:(%d+):tickets')
redis.call('HSET', purchaseKey,
'ticketId', ticket,
'eventId', string.match(ticketKey, 'event:(%d+):tickets'),
'eventId', eventIdFromKey,
'purchaseId', purchaseId,
'timestamp', timestamp,
'status', 'completed'
})
)
-- Set expiration for purchase record (24 hours)
redis.call('EXPIRE', purchaseKey, 86400)