memcache: add missing import for prod

main
Ryan Barrett 2025-01-09 18:36:26 -08:00
rodzic 708cef0ab0
commit e844e0724a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -1,11 +1,12 @@
"""Utilities for caching data in memcache."""
import functools
import logging
import os
from google.cloud.ndb.global_cache import _InProcessGlobalCache, MemcacheCache
from oauth_dropins.webutil import appengine_info
import pymemcache.client.base
from pymemcache.client.base import PooledClient
from pymemcache.serde import PickleSerde
from pymemcache.test.utils import MockMemcacheClient
@ -22,12 +23,11 @@ if appengine_info.DEBUG or appengine_info.LOCAL_SERVER:
global_cache = _InProcessGlobalCache()
else:
logger.info('Using production Memorystore memcache')
memcache = pymemcache.client.base.PooledClient(
os.environ['MEMCACHE_HOST'], timeout=10, connect_timeout=10, # seconds
allow_unicode_keys=True)
pickle_memcache = pymemcache.client.base.PooledClient(
os.environ['MEMCACHE_HOST'], timeout=10, connect_timeout=10, # seconds
serde=PickleSerde(), allow_unicode_keys=True)
memcache = PooledClient(os.environ['MEMCACHE_HOST'], allow_unicode_keys=True,
timeout=10, connect_timeout=10) # seconds
pickle_memcache = PooledClient(os.environ['MEMCACHE_HOST'],
serde=PickleSerde(), allow_unicode_keys=True,
timeout=10, connect_timeout=10) # seconds
global_cache = MemcacheCache(memcache)