mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-03-30 16:26:02 +00:00
Add safety delay for VAPID header expirity
This commit is contained in:
@@ -68,7 +68,8 @@ getVapidHeader vapidK cache uriAuthority = do
|
||||
now <- systemSeconds <$> getSystemTime
|
||||
case h of
|
||||
Nothing -> newCacheEntry now
|
||||
Just entry -> if expire entry > now then pure $ vapidHeader entry
|
||||
-- if it expires in 1 min, then we renew - for safety
|
||||
Just entry -> if expire entry > now + 60 then pure $ vapidHeader entry
|
||||
else newCacheEntry now
|
||||
where
|
||||
newCacheEntry :: Int64 -> IO B.ByteString
|
||||
|
||||
Reference in New Issue
Block a user