Changeset - 342f8434ed14
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2010-10-06 11:27:41
marcin@python-works.com
fixed creation of cache data dir, on first run
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/meta.py
Show inline comments
 
@@ -19,25 +19,30 @@ Session = scoped_session(
 
                    query_cls=caching_query.query_callable(cache_manager)
 
                )
 
          )
 

	
 
# The declarative Base
 
Base = declarative_base()
 
#For another db...
 
#Base2 = declarative_base()
 

	
 
#===============================================================================
 
# CACHE OPTIONS
 
#===============================================================================
 
cache_dir = jn(dn(dn(dn(abspath(__file__)))), 'data', 'cache')
 
cache_base = jn(dn(dn(dn(abspath(__file__)))), 'data')
 
cache_dir = jn(cache_base, 'cache')
 

	
 
if not os.path.isdir(cache_base):
 
    os.mkdir(cache_base)
 

	
 
if not os.path.isdir(cache_dir):
 
    os.mkdir(cache_dir)
 
# set start_time to current time
 
# to re-cache everything
 
# upon application startup
 
start_time = time.time()
 
# configure the "sqlalchemy" cache region.
 
cache_manager.regions['sql_cache_short'] = {
 
        'type':'memory',
 
        'data_dir':cache_dir,
 
        'expire':10,
 
        'start_time':start_time
0 comments (0 inline, 0 general)