diff options
Diffstat (limited to 'server/Handlers.hs')
-rw-r--r-- | server/Handlers.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/server/Handlers.hs b/server/Handlers.hs index 0e30d2f..987b6df 100644 --- a/server/Handlers.hs +++ b/server/Handlers.hs @@ -52,9 +52,9 @@ instance ToJSON MapService where . mapMaybe worldObject $ M.elems statuses where - worldObject (RemoteRef {..}, job) = case job of - Linted res rev _ -> - Just (A.fromText reponame .= + worldObject (remote, _current, result) = case result of + Just (Linted res rev _) -> + Just (A.fromText (reponame remote) .= M.mapWithKey (mapInfo rev) (dirresultMaps res)) _ -> Nothing mapInfo rev mappath MapResult { .. } = A.object @@ -68,8 +68,8 @@ statusImpl :: MVar ServerState -> Text -> Sha1 -> Handler JobStatus statusImpl state orgslug sha1 = do status <- liftIO $ getJobStatus state orgslug sha1 case status of - Just (_,_,jobstatus) -> pure jobstatus - Nothing -> throwError err404 + Just (_,_,jobstatus,_) -> pure jobstatus + Nothing -> throwError err404 -- | since there are multiple apis that just get state information … stateImpl @@ -83,7 +83,7 @@ relintImpl :: TQueue Job -> MVar ServerState -> Text -> Sha1 -> Handler Text relintImpl queue state orgslug sha1 = liftIO $ getJobStatus state orgslug sha1 >>= \case Nothing -> pure "there isn't a job here to restart" - Just (org, ref, _oldjob) -> do + Just (org, ref, _oldjob, _veryoldjob) -> do atomically $ writeTQueue queue (Job ref org) pure "hello" @@ -91,7 +91,7 @@ relintImpl queue state orgslug sha1 = realtimeImpl :: MVar ServerState -> Text -> Sha1 -> PendingConnection -> Handler () realtimeImpl state orgslug sha1 pending = liftIO (getJobStatus state orgslug sha1) >>= \case - Just (_org, _ref, Linted _ _ (_, realtime)) -> do + Just (_org, _ref, Linted _ _ (_, realtime), _) -> do conn <- liftIO $ acceptRequest pending incoming <- atomically $ dupTChan realtime liftIO $ withPingThread conn 30 pass $ forever $ do |