nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
15.49k stars 1.38k forks source link

The "max_file_store" option cannot be quoted #2754

Closed ColinSullivan1 closed 2 years ago

ColinSullivan1 commented 2 years ago

Defect

The server does not process a quoted string of the max_file_store option. It'd be great it if could.

$ cat quoted.conf 
jetstream {
  max_file_store: "200M"
}

$ nats-server -c quoted.conf
nats-server: quoted.conf:1:0: interface conversion: interface {} is string, not int64

Others like this should be checked as well...

hooksie1 commented 2 years ago

I took a stab at this just because I saw the open issue. Let me know if its not the direction you want to go.

hooksie1 commented 2 years ago

Ah I missed the "M" part. This doesn't address that.

hooksie1 commented 2 years ago

Ok I added some logic around parsing the string with a size suffix. Only supports K, M, G, T.

AqlaSolutions commented 2 years ago

Is there any documentation on this? How does it mix with streams DiscardPolicy? Can it be set from command line args?