Skip to content

Commit

Permalink
Merge pull request #1262 from nats-io/fix_1261
Browse files Browse the repository at this point in the history
Add RecordSizeLimit to AllOptions
  • Loading branch information
kozlovic authored Jul 22, 2022
2 parents 07ec793 + 4928491 commit 2f0c582
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 2f0c582

Please sign in to comment.