diff --git a/src/Jobs/Crontab.hs b/src/Jobs/Crontab.hs index 19411a3af..6320cb26d 100644 --- a/src/Jobs/Crontab.hs +++ b/src/Jobs/Crontab.hs @@ -365,6 +365,10 @@ determineCrontab = execWriterT $ do case closeTime of Just close -> do + -- If an exam that was previously under `ExamCloseSeparate` rules transitions to `ExamCloseOnFinish`, it might suddenly have been closed an arbitrary time ago + -- If `cronNotAfter` was only `appNotificationExpiration` in that case, no notification might ever be sent + -- That's probably fine. + changedResults <- lift . E.select . E.from $ \examResult -> do E.where_ $ examResult E.^. ExamResultExam E.==. E.val nExam E.&&. examResult E.^. ExamResultLastChanged E.>. E.val close