add runtime flag for enabling k-choices or not

any value except "off" means on

contributes to #2
This commit is contained in:
Trolli Schmittlauch 2020-09-22 23:12:07 +02:00
parent 13c5b385b1
commit 62da66aade
3 changed files with 29 additions and 21 deletions

View file

@ -26,7 +26,7 @@ main = do
readConfig :: IO (FediChordConf, ServiceConf)
readConfig = do
confDomainString : ipString : portString : servicePortString : speedupString : remainingArgs <- getArgs
confDomainString : ipString : portString : servicePortString : speedupString : loadBalancingEnabled : remainingArgs <- getArgs
-- allow starting the initial node without bootstrapping info to avoid
-- waiting for timeout
let
@ -48,6 +48,7 @@ readConfig = do
, confResponsePurgeAge = 60 / fromIntegral speedup
, confRequestTimeout = 5 * 10^6 `div` speedup
, confRequestRetries = 3
, confEnableKChoices = loadBalancingEnabled /= "off"
}
sConf = ServiceConf
{ confSubscriptionExpiryTime = 24*3600 / fromIntegral speedup