aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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