mirror of https://github.com/voidlizard/hbs2
Remove unused import in sync prelude
This commit is contained in:
parent
2564a05bce
commit
f8344d4a0c
|
@ -65,7 +65,6 @@ import System.Directory
|
|||
import System.Exit qualified as Exit
|
||||
import System.IO qualified as IO
|
||||
import UnliftIO as Exported
|
||||
import HBS2.CLI.Prelude (IsTimeout)
|
||||
|
||||
{- HLINT ignore "Functor law" -}
|
||||
{- HLINT ignore "Eta reduce" -}
|
||||
|
@ -453,6 +452,8 @@ die what = liftIO do
|
|||
hPutDoc stderr (pretty what)
|
||||
Exit.exitFailure
|
||||
|
||||
|
||||
animateSpinner :: IO (Async ())
|
||||
animateSpinner =
|
||||
async $ forM_ (cycle "|/-\\") $ \c -> do
|
||||
IO.putChar c
|
||||
|
@ -460,6 +461,7 @@ animateSpinner =
|
|||
IO.cursorBackward 1
|
||||
pause (TimeoutSec 0.25)
|
||||
|
||||
|
||||
waitForRefchan ::
|
||||
( HasClientAPI PeerAPI UNIX m
|
||||
, HasClientAPI RefChanAPI UNIX m
|
||||
|
@ -477,16 +479,13 @@ waitForRefchan refchan timeout = do
|
|||
|
||||
liftIO $ putStr "waiting for refchan "
|
||||
spinner <- liftIO animateSpinner
|
||||
res <- race (pause timeout) (wait 1)
|
||||
result <- race (pause timeout) (wait 1)
|
||||
cancel spinner
|
||||
liftIO $ do
|
||||
IO.setCursorColumn 0
|
||||
IO.clearLine
|
||||
|
||||
case res of
|
||||
Right x -> pure (Just x)
|
||||
_ -> pure Nothing
|
||||
|
||||
pure $ eitherToMaybe result
|
||||
where
|
||||
wait seconds = do
|
||||
fetchRefChanHead @UNIX refchan
|
||||
|
|
Loading…
Reference in New Issue