Commit 924501bf authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Use logger for serveJobsAPI

parent b6d34e83
......@@ -50,13 +50,16 @@ serveJobsAPI
, MonadJobStatus m
, m ~ (GargM Env BackendInternalError)
, JobEventType m ~ JobOutputType m
, MonadLogger m
)
=> JobType m
-> (JobHandle m -> input -> m ())
-> SJ.AsyncJobsServerT' ctI ctO callbacks (JobEventType m) input (JobOutputType m) m
serveJobsAPI jobType f = Internal.serveJobsAPI mkJobHandle ask jobType jobErrorToGargError $ \env jHandle i -> do
putStrLn ("Running job of type: " ++ show jobType)
runExceptT $ runReaderT (f jHandle i >> getLatestJobStatus jHandle) env
runExceptT $ flip runReaderT env $ do
$(logLocM) INFO (T.pack $ "Running job of type: " ++ show jobType)
f jHandle i
getLatestJobStatus jHandle
parseGargJob :: String -> Maybe GargJob
parseGargJob s = case s of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment