fix: upstream renterd updates

This commit is contained in:
Derrick Hammer 2023-05-04 04:11:11 -04:00
parent a3cfebab30
commit 5ad91ad263
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 3 deletions

View File

@ -39,8 +39,8 @@ type WorkerConfig struct {
SessionTTL time.Duration SessionTTL time.Duration
DownloadSectorTimeout time.Duration DownloadSectorTimeout time.Duration
UploadSectorTimeout time.Duration UploadSectorTimeout time.Duration
DownloadMaxOverdrive int DownloadMaxOverdrive uint64
UploadMaxOverdrive int UploadMaxOverdrive uint64
} }
type BusConfig struct { type BusConfig struct {
@ -284,7 +284,11 @@ func NewBus(cfg BusConfig, dir string, seed types.PrivateKey, l *zap.Logger) (ht
func NewWorker(cfg WorkerConfig, b worker.Bus, seed types.PrivateKey, l *zap.Logger) (http.Handler, ShutdownFn, error) { func NewWorker(cfg WorkerConfig, b worker.Bus, seed types.PrivateKey, l *zap.Logger) (http.Handler, ShutdownFn, error) {
workerKey := blake2b.Sum256(append([]byte("worker"), seed...)) workerKey := blake2b.Sum256(append([]byte("worker"), seed...))
w := worker.New(workerKey, cfg.ID, b, cfg.ContractLockTimeout, cfg.SessionLockTimeout, cfg.SessionReconnectTimeout, cfg.SessionTTL, cfg.BusFlushInterval, cfg.DownloadSectorTimeout, cfg.UploadSectorTimeout, cfg.DownloadMaxOverdrive, cfg.UploadMaxOverdrive, l) w, err := worker.New(workerKey, cfg.ID, b, cfg.ContractLockTimeout, cfg.SessionLockTimeout, cfg.SessionReconnectTimeout, cfg.SessionTTL, cfg.BusFlushInterval, cfg.DownloadSectorTimeout, cfg.UploadSectorTimeout, cfg.DownloadMaxOverdrive, cfg.UploadMaxOverdrive, l)
if err != nil {
return nil, nil, err
}
return w.Handler(), w.Shutdown, nil return w.Handler(), w.Shutdown, nil
} }