6378
This commit is contained in:
@@ -30,6 +30,7 @@ class BaseService:
|
||||
CACHE_SERVER = Config.CACHE_SERVER
|
||||
CACHE_PORT = Config.CACHE_PORT
|
||||
CACHE_PASSWORD = Config.CACHE_PASSWORD
|
||||
CACHE_DEFAULT_EXPIRE = Config.CACHE_DEFAULT_EXPIRE
|
||||
|
||||
@staticmethod
|
||||
def addStripeCustomer(customerData):
|
||||
@@ -407,7 +408,7 @@ class BaseService:
|
||||
|
||||
# Set a key 'foo' with value 'bar'
|
||||
json_string = json.dumps(cacheData, indent=4)
|
||||
r.set(cacheKey, json_string, ex=120)
|
||||
r.set(cacheKey, json_string, ex=BaseService.CACHE_DEFAULT_EXPIRE)
|
||||
|
||||
# Verify by getting the value
|
||||
value = r.get(cacheKey)
|
||||
|
||||
@@ -106,6 +106,7 @@ class Config:
|
||||
CACHE_PORT = os.environ.get("CACHE_PORT", 6378)
|
||||
CACHE_PASSWORD = os.environ.get("CACHE_PASSWORD",
|
||||
"7f079034e166ecf52d82cbec9876e4dc8a154b0c37248f3fa1734d4eeab938d5")
|
||||
CACHE_DEFAULT_EXPIRE = os.environ.get("CACHE_DEFAULT_EXPIRE", 21600)
|
||||
|
||||
|
||||
settings = Config()
|
||||
|
||||
Reference in New Issue
Block a user