~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to start-loggerhead.py

  • Committer: Michael Hudson
  • Date: 2008-03-03 23:10:35 UTC
  • mto: This revision was merged to the branch mainline in revision 148.
  • Revision ID: michael.hudson@canonical.com-20080303231035-3yrnrsajxpo9bgt6
poolie feedback

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
import cherrypy
13
13
cherrypy.lowercase_api = True
14
14
 
15
 
from loggerhead import daemon, release
 
15
from loggerhead import daemon, release, util
16
16
 
17
17
 
18
18
def make_handler(config, filename):
86
86
    
87
87
    turbogears.update_config(configfile="dev.cfg", modulename="loggerhead.config")
88
88
    
89
 
    potential_overrides = [ ('server.socket_port', int), ('server.webpath', str), ('server.thread_pool', int), ('server.socket_host' ,str) ]
 
89
    potential_overrides = [ ('server.socket_port', int), ('server.webpath', str), ('server.thread_pool', int) ]
90
90
    for key, keytype in potential_overrides:
91
91
        value = config.get(key, None)
92
92
        if value is not None:
110
110
    
111
111
    Root = Root(config)
112
112
    
 
113
    # re-index every 6 hours
 
114
    index_freq = config.get('cache_rebuild_frequency', 6 * 3600)
 
115
    turbogears.scheduler.add_interval_task(initialdelay=1, interval=index_freq, action=Root._check_rebuild)
 
116
 
 
117
    util.set_date_format(config.get('date_format', 'fancy'))
113
118
    try:
114
119
        turbogears.start_server(Root)
115
120
    finally: