gameServer/OfficialServer/DBInteraction.hs
changeset 7331 0e50456d652c
parent 4996 76ef3d8bd78e
child 9399 1767c92eff37
equal deleted inserted replaced
7329:92b6d8ae99e4 7331:0e50456d652c
    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)