Skip to content

Commit

Permalink
Remove debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Jan 24, 2025
1 parent 691eaa9 commit 5561503
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions unison-cli/src/Unison/Share/SyncV2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ import Control.Monad.Except
import Control.Monad.Reader (ask)
import Control.Monad.ST (ST, stToIO)
import Control.Monad.State
import Data.Attoparsec.ByteString qualified as A
import Data.Attoparsec.ByteString.Char8 qualified as A8
import Data.ByteString qualified as BS
import Data.ByteString.Lazy qualified as BL
import Data.Conduit.Attoparsec qualified as C
import Data.Conduit.List qualified as C
import Data.Conduit.Zlib qualified as C
import Data.Graph qualified as Graph
Expand Down Expand Up @@ -55,17 +58,13 @@ import Unison.Sync.Common qualified as Sync
import Unison.Sync.EntityValidation qualified as EV
import Unison.Sync.Types qualified as Share
import Unison.Sync.Types qualified as Sync
import Unison.SyncV2.API (Routes (downloadEntitiesStream))
import Unison.SyncV2.API qualified as SyncV2
import Unison.SyncV2.Types (CBORBytes)
import Unison.SyncV2.Types qualified as SyncV2
import Unison.Util.Servant.CBOR qualified as CBOR
import Unison.Util.Timing qualified as Timing
import UnliftIO qualified as IO
import Unison.SyncV2.API (Routes (downloadEntitiesStream))
import Unison.SyncV2.API qualified as SyncV2
import Data.Attoparsec.ByteString qualified as A
import Data.Attoparsec.ByteString.Char8 qualified as A8
import Data.Conduit.Attoparsec qualified as C


type Stream i o = ConduitT i o StreamM ()

Expand Down Expand Up @@ -150,7 +149,6 @@ syncFromCodeserver shouldValidate unisonShareUrl branchRef hashJwt knownHashes _
(Cli.runTransaction (Q.entityLocation hash)) >>= \case
Just Q.EntityInMainStorage -> pure $ Right ()
_ -> do
Debug.debugLogM Debug.Temp $ "Kicking off sync request"
Timing.time "Entity Download" $ do
liftIO . C.runResourceT . runExceptT $ httpStreamEntities
authHTTPClient
Expand Down Expand Up @@ -417,12 +415,10 @@ SyncV2.Routes
-- You MUST consume the stream within the callback, it will be closed when the callback returns.
withConduit :: forall r. Servant.ClientEnv -> (Stream () SyncV2.DownloadEntitiesChunk -> StreamM r) -> Servant.ClientM (Servant.SourceIO SyncV2.DownloadEntitiesChunk) -> StreamM r
withConduit clientEnv callback clientM = do
Debug.debugLogM Debug.Temp $ "Running clientM"
ExceptT $ withRunInIO \runInIO -> do
Servant.withClientM clientM clientEnv $ \case
Left err -> pure . Left . TransportError $ (handleClientError clientEnv err)
Right sourceT -> do
Debug.debugLogM Debug.Temp $ "Converting sourceIO to conduit"
conduit <- liftIO $ Servant.fromSourceIO sourceT
(runInIO . runExceptT $ callback conduit)

Expand Down

0 comments on commit 5561503

Please sign in to comment.