fix: maybe a race condition

This commit is contained in:
orion 2024-05-09 11:02:14 -05:00
parent 3d8d722871
commit eea77a3000
Signed by: orion
GPG Key ID: 6D4165AE4C928719

View File

@ -141,7 +141,7 @@ foreach stream cb = do
untilJust do untilJust do
delay $ wrap 10.0 delay $ wrap 10.0
ct <- liftEffect $ ST.toEffect $ STRef.read count ct <- liftEffect $ ST.toEffect $ STRef.read count
pure $ if ct == 0 then Just unit else Nothing pure $ if ct <= 1 then Just unit else Nothing
liftEffect $ res $ Right unit liftEffect $ res $ Right unit
pure $ Canceler $ const $ liftEffect do pure $ Canceler $ const $ liftEffect do