pub(crate) async fn ensure_kv_bucket(
js: &Context,
bucket: &str,
) -> Result<Store, Box<dyn Error + Send + Sync>>Expand description
Opens or creates the KV bucket that contains dashboard configuration.
If opening the bucket fails for any reason, the function tries to create it with a history of 5 revisions per key.
§Arguments
js- JetStream context of the server that holds the bucket.bucket- Bucket name, for exampleavenabox.
§Errors
Returns an error if the bucket cannot be opened and creating it also fails.