public void Configuration(IAppBuilder app) { //ConfigureAuth(app); CouchbaseConfig.Initialize(); var context = new OwinContext(app.Properties); var token = context.Get <CancellationToken>("host.OnAppDisposing"); if (token != CancellationToken.None) { token.Register(() => { // code to run on shutdown CouchbaseConfig.Close(); }); } }
protected void Application_End() { CouchbaseConfig.Close(); }