Closed tompipe closed 8 years ago
Can you explain the reason? What issue is it fixing?
Reading configuration values from the web.config is lazy and one time anyway as far as I'm aware. I'm not convinced the ResettableLazy<TValue>.Reset()
method is threadsafe either.
Ah you're right! I need to stop coding crazy ideas at 3am, or at least give them more thought! 😂
Gonna close this PR then, thanks anyways :)
No worries, I saw Lee's TODO whilst I had the solution open anyway, and thought i'd try help out.
@tompipe your help is always welcome :)
Me and my TODO notes eh? (it'll be my downfall)
I think I added the note as we were calling AppSettings["Ditto:DebugEnabled"]
twice, but I wasn't sure if that could be optimised on our side? (But going from @JimBobSquarePants's comment above, I've read up about it now and .NET does cache it already).
I'll remove the TODO note 😉
Added a "cacheable" lazy check of the debug mode check