import qualified OptionalConfiguration as OC (
OptionalConfiguration(..),
from_rc )
import qualified OptionalConfiguration as OC (
OptionalConfiguration(..),
from_rc )
import TSN.FeedHosts (FeedHosts(..))
import TSN.Xml (parse_xmlfid, xml_prologue)
import TSN.FeedHosts (FeedHosts(..))
import TSN.Xml (parse_xmlfid, xml_prologue)
-- fall back on the default list (which gets merged from a
-- Configuration below).
when (null $ get_feed_hosts (OC.feed_hosts opt_config)) $ do
-- fall back on the default list (which gets merged from a
-- Configuration below).
when (null $ get_feed_hosts (OC.feed_hosts opt_config)) $ do
exitWith (ExitFailure exit_no_username)
-- Finally, update a default config with any options that have been
exitWith (ExitFailure exit_no_username)
-- Finally, update a default config with any options that have been
round_robin cfg feed_host_idx = do
let hosts = get_feed_hosts $ feed_hosts cfg
let host = hosts !! feed_host_idx
round_robin cfg feed_host_idx = do
let hosts = get_feed_hosts $ feed_hosts cfg
let host = hosts !! feed_host_idx
thread_sleep 10 -- Wait 10s before attempting to reconnect.
round_robin cfg $ (feed_host_idx + 1) `mod` (length hosts)
thread_sleep 10 -- Wait 10s before attempting to reconnect.
round_robin cfg $ (feed_host_idx + 1) `mod` (length hosts)