Skip to content

Commit

Permalink
Fixed indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed Nov 26, 2020
1 parent 98f18e6 commit ce2973b
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions IHP/Job/Runner.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,20 @@ jobWorkerFetchAndRunLoop JobWorkerArgs { .. } = do
-- It will be initally be called when first starting up this job worker
-- and after that it will be called when something has been inserted into the queue (or changed to retry)
let startLoop = do
asyncJob <- Async.async do
Exception.mask $ \restore -> do
maybeJob <- Queue.fetchNextJob @job workerId
case maybeJob of
Just job -> do
putStrLn ("Starting job: " <> tshow job)
resultOrException <- Exception.try (restore (perform job))
case resultOrException of
Left exception -> Queue.jobDidFail job exception
Right _ -> Queue.jobDidSucceed job

startLoop
Nothing -> pure ()
modifyIORef allJobs (asyncJob:)
asyncJob <- Async.async do
Exception.mask $ \restore -> do
maybeJob <- Queue.fetchNextJob @job workerId
case maybeJob of
Just job -> do
putStrLn ("Starting job: " <> tshow job)
resultOrException <- Exception.try (restore (perform job))
case resultOrException of
Left exception -> Queue.jobDidFail job exception
Right _ -> Queue.jobDidSucceed job

startLoop
Nothing -> pure ()
modifyIORef allJobs (asyncJob:)

-- Start all jobs in the queue
startLoop
Expand Down

0 comments on commit ce2973b

Please sign in to comment.