Add a 1-hour expiration to all Objectify memcache uses

This protects us from the edge case of potentially stale
memcache data due to a DeadlineExceededExeption, or possibly
from MemcacheServiceException. If memcache gets stale and
misses a write that went to Datastore, it will catch up in
at most one hour.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=116174023
This commit is contained in:
Justine Tunney 2016-03-02 13:23:29 -08:00
parent 8a68acb84d
commit 689c673a7c
15 changed files with 40 additions and 17 deletions

View file

@ -17,6 +17,7 @@ package com.google.domain.registry.model.host;
import static com.google.common.collect.Sets.difference;
import static com.google.common.collect.Sets.union;
import static com.google.domain.registry.model.EppResourceUtils.projectResourceOntoBuilderAtTime;
import static com.google.domain.registry.model.ofy.Ofy.RECOMMENDED_MEMCACHE_EXPIRATION;
import static com.google.domain.registry.util.CollectionUtils.nullToEmptyImmutableCopy;
import static com.google.domain.registry.util.DateTimeUtils.START_OF_TIME;
@ -65,7 +66,7 @@ import javax.xml.bind.annotation.XmlType;
"lastEppUpdateClientId",
"lastEppUpdateTime",
"lastTransferTime" })
@Cache
@Cache(expirationSeconds = RECOMMENDED_MEMCACHE_EXPIRATION)
@Entity
@ExternalMessagingName("host")
public class HostResource extends EppResource implements ForeignKeyedEppResource {