Metaswitch/cpp-common — pull request #174 by mirw (2014-08-21 20:00:44+00:00)
Title: [Reviewer: Mike] Use relative expiry except when we want a record to expire immediately

Mike,

Please can you review this fix to #160? The issue was that using absolute time to trigger expiry is great as long as the memcached daemon has the same concept of absolute time. Unfortunately, it doesn't cope with time stepchanges very well. Rather than fixing memcached, I suggest just using relative time, except where we have to use absolute time to force expiry - in that case, we can use the earliest absolute time.

I've live-tested by
- registering and checking that memcached has the correct expiry time
- logging out while sprout is stopped (so it can't erase the entry from memcached) and checking the entry expires from memcached at the right time
- registering in and unregistering and confirming that the entry is removed from memcached immediately.

Matt

(fixes #160)