~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to start-loggerhead.py

even more simplifications

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
# read loggerhead config
56
56
 
57
57
from configobj import ConfigObj
58
 
config = sys._loggerhead_config = ConfigObj(os.path.join(home, 'loggerhead.conf'), encoding='utf-8')
 
58
config = ConfigObj(os.path.join(home, 'loggerhead.conf'), encoding='utf-8')
59
59
extra_path = config.get('bzrpath', None)
60
60
if extra_path:
61
61
    sys.path.insert(0, extra_path)
69
69
        value = keytype(value)
70
70
        turbogears.config.update({ key: value })
71
71
 
72
 
 
73
72
if not foreground:
74
73
    sys.stderr.write('\n')
75
74
    sys.stderr.write('Launching loggerhead into the background.\n')
86
85
 
87
86
from loggerhead.controllers import Root
88
87
 
 
88
Root = Root(config)
 
89
 
89
90
# re-index every 6 hours
90
 
index_freq = 6 * 3600
 
91
 
 
92
index_freq = config.get('cache_rebuild_frequency', 6 * 3600)
91
93
turbogears.scheduler.add_interval_task(initialdelay=1, interval=index_freq, action=Root._check_rebuild)
92
94
 
93
95
try: