From 212e316c7e256f7883e0b883942e98bf795d870b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 9 Dec 2020 18:11:39 +0100 Subject: [PATCH] fix(jobs): weaken crontab guarantees for performance --- src/Jobs.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Jobs.hs b/src/Jobs.hs index cdcf5d3d7..f7d1b4935 100644 --- a/src/Jobs.hs +++ b/src/Jobs.hs @@ -339,11 +339,12 @@ execCrontab = do atomically . writeTVar crontabTVar $ Just (now, currentCrontab') $logDebugS "Crontab" . intercalate "\n" $ "Current crontab:" : map tshow currentCrontab' - let doJob = mapRWST (liftHandler . runDBJobs . setSerializableBatch) $ do - newCrontab <- lift $ hoist lift determineCrontab' - when (newCrontab /= currentCrontab) $ - mapRWST (liftIO . atomically) $ - liftBase . flip writeTVar newCrontab =<< asks (jobCrontab . jobContext) + let doJob = mapRWST (liftHandler . runDBJobs) $ do + -- newCrontab <- lift $ hoist lift determineCrontab' + -- when (newCrontab /= currentCrontab) $ + -- mapRWST (liftIO . atomically) $ + -- liftBase . flip writeTVar newCrontab =<< asks (jobCrontab . jobContext) + newCrontab <- atomically . readTVar =<< asks (jobCrontab . jobContext) mergeState newState <- State.get