fix(lms): add safeguard to LmsUserlist dispatch running twice, thus ending LMS prematurely

This commit is contained in:
Steffen Jost 2023-07-12 11:16:22 +00:00
parent 1b224630eb
commit a8df40d9f8

View File

@ -304,7 +304,7 @@ dispatchJobLmsUserlist :: QualificationId -> JobHandler UniWorX
dispatchJobLmsUserlist qid = JobHandlerAtomic act
where
act :: YesodJobDB UniWorX ()
act = do
act = whenM (exists [LmsUserlistQualification ==. qid]) $ do -- safeguard against multiple calls, which would close all learners due to first case below
now <- liftIO getCurrentTime
-- result :: [(Entity LmsUser, Entity LmsUserlist)]
results <- E.select $ do