most probably fix rpc lock issue

This commit is contained in:
voidlizard 2025-02-15 13:51:36 +03:00
parent dd310888a5
commit 8ca4dd79bf
1 changed files with 2 additions and 4 deletions

View File

@ -131,13 +131,11 @@ makeRequestR :: forall api method e m . ( KnownNat (FromJust (FindMethodIndex 0
) )
=> Input method -> m (ServiceProto api e) => Input method -> m (ServiceProto api e)
makeRequestR input = do makeRequestR input = do
n <- liftIO $ randomIO @Word64
t <- getTimeCoarse <&> round @_ @Word64 . realToFrac
rnum <- atomically do rnum <- atomically do
n <- readTVar rnumnum n <- readTVar rnumnum
modifyTVar' rnumnum succ modifyTVar' rnumnum succ
pure (fromIntegral $ hash (n+t)) pure (fromIntegral n)
pure $ ServiceRequest rnum (serialise (fromIntegral idx :: Int, serialise input)) pure $ ServiceRequest rnum (serialise (fromIntegral idx :: Int, serialise input))
where where