Skip to content

Commit

Permalink
Add RecordSizeLimit to AllOptions
Browse files Browse the repository at this point in the history
Related to PR #1259
Resolves #1261

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
  • Loading branch information
kozlovic committed Jul 22, 2022
1 parent 07ec793 commit 4928491
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions stores/filestore.go
Expand Up @@ -433,6 +433,9 @@ func AllOptions(opts *FileStoreOptions) FileStoreOption {
if err := AutoSync(opts.AutoSync)(o); err != nil {
return err
}
if err := RecordSizeLimit(opts.RecordSizeLimit)(o); err != nil {
return err
}
o.CompactEnabled = opts.CompactEnabled
o.DoCRC = opts.DoCRC
o.DoSync = opts.DoSync
Expand Down
5 changes: 4 additions & 1 deletion stores/filestore_test.go
Expand Up @@ -578,6 +578,7 @@ func TestFSOptions(t *testing.T) {
ParallelRecovery: 5,
ReadBufferSize: 5 * 1024,
AutoSync: 2 * time.Minute,
RecordSizeLimit: 1024 * 1024,
}
// Create the file with custom options
fs, err := NewFileStore(testLogger, testFSDefaultDatastore, &testDefaultStoreLimits,
Expand All @@ -593,7 +594,9 @@ func TestFSOptions(t *testing.T) {
FileDescriptorsLimit(20),
ParallelRecovery(5),
ReadBufferSize(5*1024),
AutoSync(2*time.Minute))
AutoSync(2*time.Minute),
RecordSizeLimit(1024*1024),
)
if err != nil {
t.Fatalf("Unexpected error on file store create: %v", err)
}
Expand Down

0 comments on commit 4928491

Please sign in to comment.