1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Rename socket' -> sock; use void

This commit is contained in:
Rick Winfrey 2017-03-24 11:29:38 -07:00
parent 69e791c4a1
commit 9263008b15

View File

@ -76,18 +76,18 @@ reportGitmon = reportGitmon' SocketFactory { withSocket = withGitmonSocket }
reportGitmon' :: SocketFactory -> String -> ReaderT LgRepo IO a -> ReaderT LgRepo IO a reportGitmon' :: SocketFactory -> String -> ReaderT LgRepo IO a -> ReaderT LgRepo IO a
reportGitmon' SocketFactory{..} program gitCommand = reportGitmon' SocketFactory{..} program gitCommand =
join . liftIO . withSocket $ \socket' -> do join . liftIO . withSocket $ \sock -> do
(gitDir, realIP, repoName, repoID, userID) <- loadEnvVars (gitDir, realIP, repoName, repoID, userID) <- loadEnvVars
safeGitmonIO . sendAll socket' $ processJSON Update (ProcessUpdateData gitDir program realIP repoName repoID userID "semantic-diff") void . safeGitmonIO . sendAll sock $ processJSON Update (ProcessUpdateData gitDir program realIP repoName repoID userID "semantic-diff")
safeGitmonIO . sendAll socket' $ processJSON Schedule ProcessScheduleData void . safeGitmonIO . sendAll sock $ processJSON Schedule ProcessScheduleData
gitmonStatus <- safeGitmonIO $ recv socket' 1024 gitmonStatus <- safeGitmonIO $ recv sock 1024
(startTime, beforeProcIOContents) <- collectStats (startTime, beforeProcIOContents) <- collectStats
let result = withGitmonStatus gitmonStatus gitCommand let result = withGitmonStatus gitmonStatus gitCommand
(afterTime, afterProcIOContents) <- collectStats (afterTime, afterProcIOContents) <- collectStats
let (cpuTime, diskReadBytes, diskWriteBytes, resultCode) = procStats startTime afterTime beforeProcIOContents afterProcIOContents let (cpuTime, diskReadBytes, diskWriteBytes, resultCode) = procStats startTime afterTime beforeProcIOContents afterProcIOContents
safeGitmonIO . sendAll socket' $ processJSON Finish (ProcessFinishData cpuTime diskReadBytes diskWriteBytes resultCode) void . safeGitmonIO . sendAll sock $ processJSON Finish (ProcessFinishData cpuTime diskReadBytes diskWriteBytes resultCode)
pure result pure result
where where