6989a98d75
- Arkitektur: docs/auth/passwordless-architecture.md - Backend: iom/quixzoom-auth-service/ (FastAPI + Redis) - Webb: quixzoom-market-pages/se/login/ (QR-kod + polling) - App: iom/quixzoom-app/src/features/auth/ (push + deep links) Flöde: QR-kod → app-godkännande → webb-inloggad
20 lines
588 B
Lua
20 lines
588 B
Lua
--[[
|
|
Function to debounce a job.
|
|
]]
|
|
|
|
local function debounceJob(prefixKey, debounceId, ttl, jobId, debounceKey, token)
|
|
if debounceId ~= "" then
|
|
local debounceKeyExists
|
|
if ttl ~= "" then
|
|
debounceKeyExists = not rcall('SET', debounceKey, jobId, 'PX', ttl, 'NX')
|
|
else
|
|
debounceKeyExists = not rcall('SET', debounceKey, jobId, 'NX')
|
|
end
|
|
if debounceKeyExists then
|
|
local currentDebounceJobId = rcall('GET', debounceKey)
|
|
rcall("PUBLISH", prefixKey .. "debounced@" .. token, currentDebounceJobId)
|
|
|
|
return currentDebounceJobId
|
|
end
|
|
end
|
|
end |