From 9786f087cab574bc386b2792834e56a781cd8a06 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 31 Mar 2015 06:25:33 +0900 Subject: clear the Emacs event cache: --cron will do this --- src/Utility/EventCache.hs | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- cgit v1.2.3