'Get the updated time from memcache'

def updated_time(self, service_ref):

    key = ('%(topic)s:%(host)s' % service_ref)
    updated_time_in_mc = self.mc.get(str(key))
    updated_time_in_db = service_ref['updated_at']
    if updated_time_in_mc:
        updated_time_in_mc = updated_time_in_mc.replace(tzinfo=iso8601.iso8601.Utc())
        if (updated_time_in_db <= updated_time_in_mc):
            return updated_time_in_mc
    return updated_time_in_db
