# Path: gengine/base/cache.py
# def create_cache(name):
#     ch = None
# 
#     if force_redis:
#         ch = make_region().configure(
#             'dogpile.cache.redis',
#             arguments=force_redis
#         )
#     else:
#         try:
#             ch = get_region(name)
#         except:
#             ch = make_region().configure('dogpile.cache.memory')
#             warnings.warn("Warning: cache objects are in memory, are you creating docs?")
# 
#     ch.key_mangler = my_key_mangler(name)
#     
#     return ch


from gengine.base.cache import create_cache

caches = {}

cache_general = None
cache_goal_evaluation = None
cache_achievement_eval = None
cache_achievements_subjects_levels = None
cache_achievements_by_subject_for_today = None
#cache_goal_statements = None
cache_translations = None

def init_caches():
    global cache_general
    cache_general = create_cache("general")

    global cache_achievement_eval
    cache_achievement_eval = create_cache("achievement_eval")

    global cache_achievements_by_subject_for_today

# Path: gengine/base/cache.py
# def create_cache(name):
#     ch = None
# 
#     if force_redis:
#         ch = make_region().configure(
#             'dogpile.cache.redis',
#             arguments=force_redis
#         )
#     else:
#         try:
#             ch = get_region(name)
#         except:
#             ch = make_region().configure('dogpile.cache.memory')
#             warnings.warn("Warning: cache objects are in memory, are you creating docs?")
# 
#     ch.key_mangler = my_key_mangler(name)
#     
#     return ch


# Path: gengine/app/cache.py
from gengine.base.cache import create_cache


caches = {}

cache_general = None
cache_goal_evaluation = None
cache_achievement_eval = None
cache_achievements_subjects_levels = None
cache_achievements_by_subject_for_today = None
#cache_goal_statements = None
cache_translations = None

def init_caches():
    global cache_general
    cache_general = create_cache("general")

    global cache_achievement_eval
    cache_achievement_eval = create_cache("achievement_eval")

    global cache_achievements_by_subject_for_today

    cache_achievements_by_subject_for_today = create_cache("achievements_by_subject_for_today")