cleanup :: GlobalState -> IO ()
cleanup globalState = do
  torrents <- atomically $ readTVar $ globalStateTorrents globalState
  traverse_ (stopTorrent globalState) torrents
  putStrLn "quiting cleanup"
cleanup :: GlobalState -> IO ()
cleanup globalState = do
  torrents <- atomically $ readTVar $ globalStateTorrents globalState
  traverse_ (stopTorrent globalState) torrents
  putStrLn "quiting cleanup"
cleanup globalState = do
  torrents <- atomically $ readTVar $ globalStateTorrents globalState
  traverse_ (stopTorrent globalState) torrents
  putStrLn "quiting cleanup"