mirror of
https://github.com/google/nomulus
synced 2026-09-20 06:54:43 +00: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:
@@ -68,6 +68,15 @@ public class Ofy {
|
||||
|
||||
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
|
||||
|
||||
/**
|
||||
* Recommended memcache expiration time, which is one hour, specified in seconds.
|
||||
* <p>
|
||||
* This value should used as a cache expiration time for any entities annotated with an Objectify
|
||||
* {@code @Cache} annotation, to put an upper bound on unlikely-but-possible divergence between
|
||||
* memcache and datastore when a memcache write fails.
|
||||
*/
|
||||
public static final int RECOMMENDED_MEMCACHE_EXPIRATION = 3600;
|
||||
|
||||
/** Default clock for transactions that don't provide one. */
|
||||
@NonFinalForTesting
|
||||
static Clock clock = new SystemClock();
|
||||
|
||||
Reference in New Issue
Block a user