diff --git a/markets/dagstore/wrapper.go b/markets/dagstore/wrapper.go index 620c97abe..9a31d68c3 100644 --- a/markets/dagstore/wrapper.go +++ b/markets/dagstore/wrapper.go @@ -90,7 +90,7 @@ func NewDAGStore(cfg config.DAGStoreConfig, mountApi MinerAPI) (*dagstore.DAGSto mountApi: mountApi, failureCh: failureCh, traceCh: traceCh, - gcInterval: time.Duration(cfg.GCIntervalMillis) * time.Millisecond, + gcInterval: time.Duration(cfg.GCInterval), } return dagst, w, nil diff --git a/markets/dagstore/wrapper_test.go b/markets/dagstore/wrapper_test.go index c6e4e2f38..a48497d85 100644 --- a/markets/dagstore/wrapper_test.go +++ b/markets/dagstore/wrapper_test.go @@ -29,10 +29,10 @@ func TestWrapperAcquireRecovery(t *testing.T) { // Create a DAG store wrapper dagst, w, err := NewDAGStore(config.DAGStoreConfig{ - TransientsDir: t.TempDir(), - IndexDir: t.TempDir(), - DatastoreDir: t.TempDir(), - GCIntervalMillis: 1, + TransientsDir: t.TempDir(), + IndexDir: t.TempDir(), + DatastoreDir: t.TempDir(), + GCInterval: config.Duration(1 * time.Millisecond), }, mockLotusMount{}) require.NoError(t, err) @@ -82,10 +82,10 @@ func TestWrapperBackground(t *testing.T) { // Create a DAG store wrapper dagst, w, err := NewDAGStore(config.DAGStoreConfig{ - TransientsDir: t.TempDir(), - IndexDir: t.TempDir(), - DatastoreDir: t.TempDir(), - GCIntervalMillis: 1, + TransientsDir: t.TempDir(), + IndexDir: t.TempDir(), + DatastoreDir: t.TempDir(), + GCInterval: config.Duration(1 * time.Millisecond), }, mockLotusMount{}) require.NoError(t, err) diff --git a/node/config/def.go b/node/config/def.go index 9b76a2226..7637142cd 100644 --- a/node/config/def.go +++ b/node/config/def.go @@ -195,7 +195,7 @@ func DefaultStorageMiner() *StorageMiner { MaxConcurrentIndex: 5, MaxConcurrentReadyFetches: 2, MaxConcurrencyStorageCalls: 100, - GCIntervalMillis: 60000, + GCInterval: Duration(1 * time.Minute), }, } cfg.Common.API.ListenAddress = "/ip4/127.0.0.1/tcp/2345/http" diff --git a/node/config/types.go b/node/config/types.go index b3f038df4..9f77ee7a4 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -86,9 +86,10 @@ type DAGStoreConfig struct { // Default value: 100. MaxConcurrencyStorageCalls int - // The number of milliseconds between calls to periodic dagstore GC. - // Default value: 60000 (60 seconds = 1 minute). - GCIntervalMillis int + // The time between calls to periodic dagstore GC, in time.Duration string + // representation, e.g. 1m, 5m, 1h. + // Default value: 1 minute. + GCInterval Duration } type MinerSubsystemConfig struct {