LOTUS_DAGSTORE_COPY_CONCURRENCY for controlling copy concurrency.
This commit is contained in:
parent
88efbfa6ff
commit
72391cca20
@ -9,6 +9,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -615,13 +616,23 @@ func DagStoreWrapper(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var maxCopies = 2
|
||||||
|
// TODO replace env with config.toml attribute.
|
||||||
|
v, ok := os.LookupEnv("LOTUS_DAGSTORE_COPY_CONCURRENCY")
|
||||||
|
if ok {
|
||||||
|
concurrency, err := strconv.Atoi(v)
|
||||||
|
if err == nil {
|
||||||
|
maxCopies = concurrency
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cfg := dagstore.MarketDAGStoreConfig{
|
cfg := dagstore.MarketDAGStoreConfig{
|
||||||
TransientsDir: filepath.Join(dagStoreDir, "transients"),
|
TransientsDir: filepath.Join(dagStoreDir, "transients"),
|
||||||
IndexDir: filepath.Join(dagStoreDir, "index"),
|
IndexDir: filepath.Join(dagStoreDir, "index"),
|
||||||
Datastore: dagStoreDS,
|
Datastore: dagStoreDS,
|
||||||
GCInterval: 1 * time.Minute,
|
GCInterval: 1 * time.Minute,
|
||||||
MaxConcurrentIndex: 5,
|
MaxConcurrentIndex: 5,
|
||||||
MaxConcurrentCopies: 2,
|
MaxConcurrentCopies: maxCopies,
|
||||||
}
|
}
|
||||||
|
|
||||||
dsw, err := dagstore.NewDagStoreWrapper(cfg, lotusAccessor)
|
dsw, err := dagstore.NewDagStoreWrapper(cfg, lotusAccessor)
|
||||||
|
Loading…
Reference in New Issue
Block a user