equal
deleted
inserted
replaced
58 q <- readChan queries |
58 q <- readChan queries |
59 (updatedCache, newReq) <- case q of |
59 (updatedCache, newReq) <- case q of |
60 CheckAccount clId clUid clNick _ -> do |
60 CheckAccount clId clUid clNick _ -> do |
61 let cacheEntry = clNick `Map.lookup` accountsCache |
61 let cacheEntry = clNick `Map.lookup` accountsCache |
62 currentTime <- getCurrentTime |
62 currentTime <- getCurrentTime |
63 if (isNothing cacheEntry) || (currentTime `diffUTCTime` (fst . fromJust) cacheEntry > 2 * 24 * 60 * 60) then |
63 if (isNothing cacheEntry) || (currentTime `diffUTCTime` (fst . fromJust) cacheEntry > 10 * 60) then |
64 do |
64 do |
65 SIO.hPutStrLn hIn $ show q |
65 SIO.hPutStrLn hIn $ show q |
66 hFlush hIn |
66 hFlush hIn |
67 |
67 |
68 (clId', clUid', accountInfo) <- SIO.hGetLine hOut >>= (maybeException . maybeRead) |
68 (clId', clUid', accountInfo) <- SIO.hGetLine hOut >>= (maybeException . maybeRead) |