about summary refs log tree commit diff
path: root/src/BlogDB.hs
diff options
context:
space:
mode:
authorVincent Ambo <v.ambo@me.com>2012-03-13T23·37+0100
committerVincent Ambo <v.ambo@me.com>2012-03-13T23·37+0100
commite6746984f585168229d902096e22177a6e55a6c2 (patch)
tree9f04039b20801d56e0da9bf9c232fb87a4cb05d6 /src/BlogDB.hs
parentf6446aec725234ea38b5431defa8e4c987e07f20 (diff)
* changed comment structure to sort by UTCTime
* postEntry function done; adminHandler doesn't work?
Diffstat (limited to 'src/BlogDB.hs')
-rw-r--r--src/BlogDB.hs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/BlogDB.hs b/src/BlogDB.hs
index d5a964da8a5a..7a4f869eb71b 100644
--- a/src/BlogDB.hs
+++ b/src/BlogDB.hs
@@ -40,10 +40,10 @@ instance Show BlogLang where
 
 $(deriveSafeCopy 0 'base ''BlogLang)
 
-data Comment = Comment { 
+data Comment = Comment {
+    cdate   :: UTCTime,
     cauthor :: Text,
-    ctext   :: Text,
-    cdate   :: UTCTime
+    ctext   :: Text
 } deriving (Eq, Ord, Show, Data, Typeable)
 
 $(deriveSafeCopy 0 'base ''Comment)
@@ -221,11 +221,18 @@ interactiveUserAdd = do
   putStrLn "Password:"
   pw <- getLine
   update' acid (AddUser (pack un) pw)
-  createCheckpointAndClose acid
+  closeAcidState acid
 
 flushSessions :: IO ()
 flushSessions = do
   tbDir <- getEnv "TAZBLOG"
   acid <- openLocalStateFrom (tbDir ++ "/BlogState") initialBlogState
   update' acid (ClearSessions)
-  createCheckpointAndClose acid
+  closeAcidState acid
+
+archiveState :: IO ()
+archiveState = do
+    tbDir <- getEnv "TAZBLOG"
+    acid <- openLocalStateFrom (tbDir ++ "/BlogState") initialBlogState
+    createArchive acid
+    closeAcidState acid