Fix tests, circle and make ux nicer

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera
2019-12-06 22:49:44 +01:00
parent d53e43c24d
commit 92e7b4afbf
5 changed files with 16 additions and 19 deletions
+11 -14
View File
@@ -120,7 +120,7 @@ type Config struct {
Miner address.Address
WorkerThreads uint8
OverrideLastID uint64
FallbackLastID uint64
CacheDir string
SealedDir string
@@ -144,21 +144,18 @@ func New(cfg *Config, ds dtypes.MetadataDS) (*SectorBuilder, error) {
}
var lastUsedID uint64
if cfg.OverrideLastID != 0 {
lastUsedID = cfg.OverrideLastID
} else {
b, err := ds.Get(lastSectorIdKey)
switch err {
case nil:
i, err := strconv.ParseInt(string(b), 10, 64)
if err != nil {
return nil, err
}
lastUsedID = uint64(i)
case datastore.ErrNotFound:
default:
b, err := ds.Get(lastSectorIdKey)
switch err {
case nil:
i, err := strconv.ParseInt(string(b), 10, 64)
if err != nil {
return nil, err
}
lastUsedID = uint64(i)
case datastore.ErrNotFound:
lastUsedID = cfg.FallbackLastID
default:
return nil, err
}
rlimit := cfg.WorkerThreads - PoStReservedWorkers