mddub / urchin-cgm

A graph of your CGM data on a Pebble watch.
MIT License
56 stars 45 forks source link

Limit SGV cache by date, not count #45

Closed mddub closed 7 years ago

mddub commented 7 years ago

For #42.

The entries collection can be cached based on timestamp because it has a date field formatted as milliseconds. Other collections use date strings, which are not amenable to querying/comparing because different devices zone or format the date string differently. Thus they are still cached based on count instead.

jasoncalabrese commented 7 years ago

Thanks, I'll give it a try. Deltas have been mostly ok, but I think the buckets that we're using in oref0 and NS are the way to go. At first I wanted to do deltas by device, but in some cases, such as xdrip or old uploaders the device name will be the same or won't be set at all.

jasoncalabrese commented 7 years ago

Built and installed on my pebble, I'll watch it and let you know how it looks

jasoncalabrese commented 7 years ago

Been working great, and much better than my hack

mddub commented 7 years ago

Great to hear, thanks for testing!

One more thing before I merge: mind testing clearing the cache? Just change your Nightscout URL to a dummy URL and back.

jasoncalabrese commented 7 years ago

Waited till there's was couple hours of 2 rigs uploading, working good, loads fully after clearing the cache with the URL trick

mddub commented 7 years ago

Awesome, thanks!