CadyIO / hangfire-ravendb

RavenDB job storage for Hangfire
https://www.nuget.org/packages/Hangfire.Raven/
18 stars 35 forks source link

Production API Key configuration #4

Closed stephenstroud closed 8 years ago

stephenstroud commented 8 years ago

How do I configure the connection string for production use with an API Key, the raven instance is located on another server so I'm using the secure API Key.

GlobalConfiguration.Configuration.UseRavenStorage("connection_string", "database_name");

The connection string contains Url at the start which causing the http/https exception. Of course I dropped the URL part but it comes with the api key and database name already.

Options from Raven are:

Connection String: "Url = http://localhost:8080; ApiKey = esting/cheeolfngotns; Database = Testing" Direct Link: "http://localhost:8080/studio/index.html#api-key=testing/cheeolfngotns"

I've tried all sorts of variations to get it working but it errors with:

System.ObjectDisposedException: The document store has already been disposed and cannot be used Object name: 'DocumentStore'.

This works fine localhost without the API key

AndrewMarkley commented 8 years ago

Unfortunately, this never made it into production for us. It was only tested against a development version of raven. If you'd like to take the time to fix it and submit a pull request I'll merge it right away and update the nuget package for you.

stephenstroud commented 8 years ago

Sure i'll create a PR

stephenstroud commented 8 years ago

PR Created - also tested and using in a production environment.