Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 7f66ae8

Browse files
committed
[CBR-475] remove async calls from TxMeta internals
1 parent 482057e commit 7f66ae8

File tree

1 file changed

+2
-10
lines changed
  • wallet-new/src/Cardano/Wallet/Kernel/DB

1 file changed

+2
-10
lines changed

wallet-new/src/Cardano/Wallet/Kernel/DB/Sqlite.hs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ import qualified Data.Foldable as Foldable
6666
import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
6767
import qualified Data.List.NonEmpty as NonEmpty
6868
import qualified Data.Map as M
69-
import Data.Time.Units (Second, fromMicroseconds, toMicroseconds)
69+
import Data.Time.Units (fromMicroseconds, toMicroseconds)
7070
import Database.Beam.Migrate (CheckedDatabaseSettings, DataType (..),
7171
Migration, MigrationSteps, boolean, collectChecks,
7272
createTable, evaluateDatabase, executeMigration, field,
@@ -79,7 +79,6 @@ import Cardano.Wallet.Kernel.DB.TxMeta.Types (AccountFops (..),
7979
FilterOperation (..), Limit (..), Offset (..),
8080
SortCriteria (..), SortDirection (..), Sorting (..))
8181
import qualified Cardano.Wallet.Kernel.DB.TxMeta.Types as Kernel
82-
import Cardano.Wallet.WalletLayer.ExecutionTimeLimit
8382

8483
import qualified Pos.Chain.Txp as Txp
8584
import qualified Pos.Core as Core
@@ -600,7 +599,7 @@ getTxMetas conn (Offset offset) (Limit limit) accountFops mbAddress fopTxId fopT
600599
Left e -> throwIO $ Kernel.StorageFailure (toException e)
601600
Right Nothing -> return ([], Just 0)
602601
Right (Just (meta, inputs, outputs)) -> do
603-
eiCount <- limitExecutionTimeTo (25 :: Second) (\ _ -> ()) $ ignoreLeft $ Sqlite.runDBAction $ runBeamSqlite conn $
602+
eiCount <- Sqlite.runDBAction $ runBeamSqlite conn $
604603
case mbAddress of
605604
Nothing -> SQL.runSelectReturningOne $ SQL.select metaQueryC
606605
Just addr -> SQL.runSelectReturningOne $ SQL.select $ metaQueryWithAddrC addr
@@ -613,13 +612,6 @@ getTxMetas conn (Offset offset) (Limit limit) accountFops mbAddress fopTxId fopT
613612
return (txMeta, count)
614613

615614
where
616-
ignoreLeft :: IO (Either a b) -> IO (Either () b)
617-
ignoreLeft m = do
618-
x <- m
619-
case x of
620-
Left _ -> return $ Left ()
621-
Right r -> return $ Right r
622-
623615
filters meta = do
624616
SQL.guard_ $ filterAccs meta accountFops
625617
SQL.guard_ $ applyFilter (_txMetaTableId meta) fopTxId

0 commit comments

Comments
 (0)