add --clusterjobs option and default to 1
The default of 1 is not ideal at all, but it avoids an accidental M*N causing so much concurrency it becomes unusable.
This commit is contained in:
parent
1259ad89b6
commit
fbbedae497
8 changed files with 60 additions and 30 deletions
|
@ -41,6 +41,7 @@ data Options = Options
|
|||
, unauthAppendOnlyOption :: Bool
|
||||
, wideOpenOption :: Bool
|
||||
, proxyConnectionsOption :: Maybe Integer
|
||||
, clusterJobsOption :: Maybe Int
|
||||
}
|
||||
|
||||
optParser :: CmdParamsDesc -> Parser Options
|
||||
|
@ -89,10 +90,16 @@ optParser _ = Options
|
|||
( long "proxyconnections" <> metavar paramNumber
|
||||
<> help "maximum number of idle connections when proxying"
|
||||
))
|
||||
<*> optional (option auto
|
||||
( long "clusterjobs" <> metavar paramNumber
|
||||
<> help "number of concurrent node accesses per connection"
|
||||
))
|
||||
|
||||
seek :: Options -> CommandSeek
|
||||
seek o = getAnnexWorkerPool $ \workerpool ->
|
||||
withP2PConnections workerpool (fromMaybe 1 $ proxyConnectionsOption o)
|
||||
withP2PConnections workerpool
|
||||
(fromMaybe 1 $ proxyConnectionsOption o)
|
||||
(fromMaybe 1 $ clusterJobsOption o)
|
||||
(go workerpool)
|
||||
where
|
||||
go workerpool acquireconn = liftIO $ do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue