aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-03-31 06:25:33 +0900
committerSean Whitton <spwhitton@spwhitton.name>2015-03-31 06:25:33 +0900
commit9786f087cab574bc386b2792834e56a781cd8a06 (patch)
tree5008dbcd3de898c569a54104eda51ca1047eac8b
parent29f2cd0f455291e134a1d23d2da21c950ba3f1dd (diff)
downloadsrem-9786f087cab574bc386b2792834e56a781cd8a06.tar.gz
clear the Emacs event cache: --cron will do this
-rw-r--r--src/Utility/EventCache.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Utility/EventCache.hs b/src/Utility/EventCache.hs
index a437595..a962286 100644
--- a/src/Utility/EventCache.hs
+++ b/src/Utility/EventCache.hs
@@ -23,6 +23,7 @@
module Utility.EventCache ( purgeOldEventCaches
, appendManualEventCache
+ , refreshEmacsEventCache
, readEmacsEventCache
, readManualEventCache
) where
@@ -60,6 +61,14 @@ appendManualEventCache r d = do
let path = dir </> "manual_" ++ (showGregorian d) ++ ".csv"
appendFile path $ makeEventsCSV [r]
+refreshEmacsEventCache :: IO ()
+refreshEmacsEventCache = do
+ date <- todaysCacheFileDateString
+ dir <- SremConfig.getCacheDirectory
+ let path = dir </> "emacs_" ++ date ++ ".csv"
+ removeFile path
+ `catch` ((\_ -> return ()) :: IOException -> IO ())
+
readEmacsEventCache :: IO [Reminder]
readEmacsEventCache = do
date <- todaysCacheFileDateString