File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
services/brig/src/Brig/Data Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ import Brig.Types.User.Auth (CookieLabel)
53
53
import Brig.User.Auth.DB.Instances ()
54
54
import Cassandra as C hiding (Client )
55
55
import Control.Error
56
+ import qualified Control.Exception.Lens as EL
56
57
import Control.Lens
57
58
import Control.Monad.Catch
58
59
import Control.Monad.Random (randomRIO )
@@ -386,20 +387,20 @@ withOptLock u c ma = go (10 :: Int)
386
387
cmd <- mkCmd <$> view (awsEnv . prekeyTable)
387
388
e <- view (awsEnv . amazonkaEnv)
388
389
m <- view metrics
389
- execDyn' e m cnv cmd
390
+ liftIO $ execDyn' e m cnv cmd
390
391
where
391
392
execDyn' ::
392
- forall y p m .
393
- ( AWS. AWSRequest p , MonadUnliftIO m , MonadMask m , MonadIO m ) =>
393
+ forall y p .
394
+ AWS. AWSRequest p =>
394
395
AWS. Env ->
395
396
Metrics. Metrics ->
396
397
(AWS. Rs p -> Maybe y ) ->
397
398
p ->
398
- m (Maybe y )
399
+ IO (Maybe y )
399
400
execDyn' e m conv cmd = recovering policy handlers (const run)
400
401
where
401
402
run = execCatch e cmd >>= either handleErr (return . conv)
402
- handlers = httpHandlers ++ [const $ Handler $ pure . const True . preview ( AWS. _ConditionalCheckFailedException @ SomeException )]
403
+ handlers = httpHandlers ++ [const $ EL. handler_ AWS. _ConditionalCheckFailedException ( pure True )]
403
404
policy = limitRetries 3 <> exponentialBackoff 100000
404
405
handleErr (AWS. ServiceError se) | se ^. AWS. serviceCode == AWS. ErrorCode " ProvisionedThroughputExceeded" = do
405
406
Metrics. counterIncr (Metrics. path " client.opt_lock.provisioned_throughput_exceeded" ) m
You can’t perform that action at this time.
0 commit comments