Skip to content

Commit

Permalink
Remove writeSubst
Browse files Browse the repository at this point in the history
Summary: I don't remember what this was for, but we apparently don't use it.

Reviewed By: phlalx, josefs

Differential Revision: D68622344

fbshipit-source-id: 2d32c88f713a277d4c1bc089c76c7032ebcfbe4e
  • Loading branch information
Simon Marlow authored and facebook-github-bot committed Jan 27, 2025
1 parent 67a4bfb commit bf52076
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
1 change: 0 additions & 1 deletion glean/db/Glean/Database/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ data Write = Write
data WriteContent = WriteContent
{ writeBatch :: !Thrift.Batch
, writeOwnership :: Maybe DefineOwnership
, writeSubst :: Subst -> Subst
}

-- | A Write on the WriteQueue
Expand Down
1 change: 0 additions & 1 deletion glean/db/Glean/Database/Write/Batch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ writeContentFromBatch :: Thrift.Batch -> WriteContent
writeContentFromBatch writeBatch = WriteContent
{ writeBatch = writeBatch
, writeOwnership = Nothing
, writeSubst = id
}

syncWriteDatabase
Expand Down
10 changes: 1 addition & 9 deletions glean/db/Glean/Write/JSON.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,12 @@ import Glean.RTS.Builder
import Glean.RTS.Set
import Glean.RTS.Constants
import qualified Glean.RTS.Foreign.JSON as J
import Glean.RTS.Foreign.Subst as Subst (empty)
import Glean.RTS.Types
import Glean.Angle.Types hiding (Type)
import Glean.Schema.Util
import Glean.Types as Thrift hiding (Value, Nat, Byte)


-- just an empty Subst for now. Later we might implement
-- returning substitutions from JSON writes.
emptySubst :: IO Batch -> IO WriteContent
emptySubst batchIO = do
wc <- writeContentFromBatch <$> batchIO
return wc{writeSubst = const Subst.empty}

syncWriteJsonBatch
:: Env
-> Repo
Expand All @@ -84,7 +76,7 @@ writeJsonBatch
-> IO WriteContent
writeJsonBatch env repo SendJsonBatch{..} = do
dbSchema <- withOpenDatabase env repo (return . Database.odbSchema)
emptySubst $
writeContentFromBatch <$>
buildJsonBatch dbSchema sendJsonBatch_options sendJsonBatch_batches

buildJsonBatch
Expand Down

0 comments on commit bf52076

Please sign in to comment.