nathanwoulfe / PieMan

Simple analytics for Umbraco
MIT License
11 stars 6 forks source link

Google token expiring #15

Open adkwatt opened 6 years ago

adkwatt commented 6 years ago

It looks like the credentials created by GoogleService.CreateFromRefreshToken expire after about an hour. Since it's a static object, the token doesn't get refreshed until the app is restarted, and PieMan appears broken during that time. I patched it for myself by having EnsureGoogleService() create a new object whenever it's called like it used to. You may want to put it on a cache or timer or maybe create one object per request.

nathanwoulfe commented 6 years ago

I'd happily merge that in if you want to raise a PR.