diff --git a/server/filestore.go b/server/filestore.go index 9696710d..dd821812 100644 --- a/server/filestore.go +++ b/server/filestore.go @@ -2163,7 +2163,7 @@ func (fs *fileStore) streamSnapshot(w io.WriteCloser, blks []*msgBlock, includeC } // Create a snapshot of this stream and its consumer's state along with messages. -func (fs *fileStore) Snapshot(deadline time.Duration, includeConsumers, checkMsgs bool) (*SnapshotResult, error) { +func (fs *fileStore) Snapshot(deadline time.Duration, checkMsgs, includeConsumers bool) (*SnapshotResult, error) { fs.mu.Lock() if fs.closed { fs.mu.Unlock() diff --git a/server/filestore_test.go b/server/filestore_test.go index 79523518..48febb74 100644 --- a/server/filestore_test.go +++ b/server/filestore_test.go @@ -1245,7 +1245,7 @@ func TestFileStoreSnapshot(t *testing.T) { // Now check to make sure that we get the correct error when trying to delete or erase // a message when a snapshot is in progress and that closing the reader releases that condition. - sr, err := fs.Snapshot(5*time.Second, true, false) + sr, err := fs.Snapshot(5*time.Second, false, true) if err != nil { t.Fatalf("Error creating snapshot") } diff --git a/server/stream.go b/server/stream.go index 7aa68daf..be40d5c8 100644 --- a/server/stream.go +++ b/server/stream.go @@ -978,7 +978,7 @@ func (mset *Stream) Snapshot(deadline time.Duration, checkMsgs, includeConsumers o.writeState() } - return store.Snapshot(deadline, includeConsumers, checkMsgs) + return store.Snapshot(deadline, checkMsgs, includeConsumers) } const snapsDir = "__snapshots__"