From 43d587b2ad971f2d4213570fbfcaf836c0e63dfe Mon Sep 17 00:00:00 2001 From: nek0 Date: Tue, 28 Jul 2015 21:48:09 +0200 Subject: [PATCH] toying with Avatar caching --- Handler/Avatar.hs | 3 ++- config/models | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Handler/Avatar.hs b/Handler/Avatar.hs index ecfa8bc..9b7f748 100644 --- a/Handler/Avatar.hs +++ b/Handler/Avatar.hs @@ -25,7 +25,8 @@ postNewAvatarR = do FormSuccess na -> do raw <- runResourceT $ fileSource (avatarNewFile na) $$ sinkLbs thumb <- generateThumb $ B.concat $ L.toChunks raw - runDB $ insert_ $ Avatar (avatarNewIdent na) thumb + now <- liftIO $ getCurrentTime + runDB $ insert_ $ Avatar (avatarNewIdent na) thumb now setMessageI MsgAvatarUploadSuccessfull redirect $ HomeR _ -> do diff --git a/config/models b/config/models index 7641baa..13c11ad 100644 --- a/config/models +++ b/config/models @@ -32,6 +32,7 @@ CashCheck Avatar ident Text data ByteString + altTime UTCTime default=now() deriving Typeable Show Barcode code Text