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-04 16:19:40 -05:00
parent 8a68acb84d
commit 689c673a7c
15 changed files with 40 additions and 17 deletions
@@ -19,6 +19,7 @@ import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Verify.verify;
import static com.google.domain.registry.model.ofy.ObjectifyService.allocateId;
import static com.google.domain.registry.model.ofy.ObjectifyService.ofy;
import static com.google.domain.registry.model.ofy.Ofy.RECOMMENDED_MEMCACHE_EXPIRATION;
import static com.google.domain.registry.util.CacheUtils.memoizeWithShortExpiration;
import static com.google.domain.registry.util.DateTimeUtils.START_OF_TIME;
@@ -245,7 +246,7 @@ public class ClaimsListShard extends ImmutableObject {
* that is live.
*/
@Entity
@Cache
@Cache(expirationSeconds = RECOMMENDED_MEMCACHE_EXPIRATION)
@NotBackedUp(reason = Reason.EXTERNALLY_SOURCED)
public static class ClaimsListSingleton extends CrossTldSingleton {
Key<ClaimsListRevision> activeRevision;
@@ -16,6 +16,7 @@ package com.google.domain.registry.model.tmch;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.domain.registry.model.ofy.ObjectifyService.ofy;
import static com.google.domain.registry.model.ofy.Ofy.RECOMMENDED_MEMCACHE_EXPIRATION;
import com.google.domain.registry.model.annotations.NotBackedUp;
import com.google.domain.registry.model.annotations.NotBackedUp.Reason;
@@ -32,7 +33,7 @@ import javax.annotation.concurrent.Immutable;
/** Datastore singleton for ICANN's TMCH CA certificate revocation list (CRL). */
@Entity
@Cache
@Cache(expirationSeconds = RECOMMENDED_MEMCACHE_EXPIRATION)
@Immutable
@NotBackedUp(reason = Reason.EXTERNALLY_SOURCED)
public final class TmchCrl extends CrossTldSingleton {