mirror of
https://github.com/google/nomulus.git
synced 2025-05-31 01:34:05 +02:00
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:
parent
8a68acb84d
commit
689c673a7c
15 changed files with 40 additions and 17 deletions
|
@ -16,6 +16,7 @@ package com.google.domain.registry.model.index;
|
|||
|
||||
import static com.google.common.collect.Maps.filterValues;
|
||||
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.TypeUtils.instantiate;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
|
@ -46,17 +47,17 @@ import java.util.Map;
|
|||
public abstract class ForeignKeyIndex<E extends EppResource> extends BackupGroupRoot {
|
||||
|
||||
/** The {@link ForeignKeyIndex} type for {@link ContactResource} entities. */
|
||||
@Cache
|
||||
@Cache(expirationSeconds = RECOMMENDED_MEMCACHE_EXPIRATION)
|
||||
@Entity
|
||||
public static class ForeignKeyContactIndex extends ForeignKeyIndex<ContactResource> {}
|
||||
|
||||
/** The {@link ForeignKeyIndex} type for {@link DomainResource} entities. */
|
||||
@Cache
|
||||
@Cache(expirationSeconds = RECOMMENDED_MEMCACHE_EXPIRATION)
|
||||
@Entity
|
||||
public static class ForeignKeyDomainIndex extends ForeignKeyIndex<DomainResource> {}
|
||||
|
||||
/** The {@link ForeignKeyIndex} type for {@link HostResource} entities. */
|
||||
@Cache
|
||||
@Cache(expirationSeconds = RECOMMENDED_MEMCACHE_EXPIRATION)
|
||||
@Entity
|
||||
public static class ForeignKeyHostIndex extends ForeignKeyIndex<HostResource> {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue