I've been running this plugin on a web app which now runs some tasks in the background via Quartz.Net.
The tasks' dependencies are injected from our IoC container, and one the dependencies is a IDocumentSession.
Since these tasks run in the background there is no http context, and opening a session crashes with the following stack trace:
System.NullReferenceException: Object reference not set to an instance of an object.
at Glimpse.AspNet.AspNetFrameworkProvider.get_HttpRequestStore()
at Glimpse.Core.Framework.Factory.<>cDisplayClass2.b1()
at Glimpse.RavenDb.Profiler.PointOnTimeline(String message) in c:\Projects\Glimpse.RavenDb\Glimpse.RavenDb\Profiler.cs:line 107
at Glimpse.RavenDb.Profiler.TrackSession(InMemoryDocumentSessionOperations session) in c:\Projects\Glimpse.RavenDb\Glimpse.RavenDb\Profiler.cs:line 86
at Raven.Client.DocumentStoreBase.AfterSessionCreated(InMemoryDocumentSessionOperations session)
at Raven.Client.Document.DocumentStore.AfterSessionCreated(InMemoryDocumentSessionOperations session)
at Raven.Client.Document.DocumentStore.OpenSession(OpenSessionOptions options)
at Raven.Client.Document.DocumentStore.OpenSession()
My expectation would be for glimpse to be "mute" when running outside of an http request, and I'd very much would like to avoid having to set another document store with no profiling just for the background tasks.
Is this a bug? Is there a way to avoid this and keep the profiler set up?
I've been running this plugin on a web app which now runs some tasks in the background via Quartz.Net.
The tasks' dependencies are injected from our IoC container, and one the dependencies is a IDocumentSession. Since these tasks run in the background there is no http context, and opening a session crashes with the following stack trace:
System.NullReferenceException: Object reference not set to an instance of an object. at Glimpse.AspNet.AspNetFrameworkProvider.get_HttpRequestStore() at Glimpse.Core.Framework.Factory.<>cDisplayClass2.b 1()
at Glimpse.RavenDb.Profiler.PointOnTimeline(String message) in c:\Projects\Glimpse.RavenDb\Glimpse.RavenDb\Profiler.cs:line 107
at Glimpse.RavenDb.Profiler.TrackSession(InMemoryDocumentSessionOperations session) in c:\Projects\Glimpse.RavenDb\Glimpse.RavenDb\Profiler.cs:line 86
at Raven.Client.DocumentStoreBase.AfterSessionCreated(InMemoryDocumentSessionOperations session)
at Raven.Client.Document.DocumentStore.AfterSessionCreated(InMemoryDocumentSessionOperations session)
at Raven.Client.Document.DocumentStore.OpenSession(OpenSessionOptions options)
at Raven.Client.Document.DocumentStore.OpenSession()
My expectation would be for glimpse to be "mute" when running outside of an http request, and I'd very much would like to avoid having to set another document store with no profiling just for the background tasks.
Is this a bug? Is there a way to avoid this and keep the profiler set up?