mirror of
https://github.com/simon987/od-database.git
synced 2025-04-19 10:26:44 +00:00
Should fix export problem
This commit is contained in:
parent
5c386707ed
commit
c92f2f4937
1
app.py
1
app.py
@ -36,6 +36,7 @@ app.jinja_env.globals.update(get_mime=od_util.get_category)
|
||||
|
||||
taskManager = TaskManager()
|
||||
searchEngine = ElasticSearchEngine("od-database")
|
||||
searchEngine.start_stats_scheduler()
|
||||
|
||||
|
||||
@app.template_filter("date_format")
|
||||
|
@ -50,12 +50,14 @@ class ElasticSearchEngine(SearchEngine):
|
||||
self.index_name = index_name
|
||||
self.es = elasticsearch.Elasticsearch()
|
||||
|
||||
if not self.es.indices.exists(self.index_name):
|
||||
self.init()
|
||||
|
||||
def start_stats_scheduler(self):
|
||||
scheduler = BackgroundScheduler()
|
||||
scheduler.add_job(self._generate_global_stats, "interval", seconds=60 * 120)
|
||||
scheduler.start()
|
||||
|
||||
if not self.es.indices.exists(self.index_name):
|
||||
self.init()
|
||||
|
||||
def init(self):
|
||||
print("Elasticsearch first time setup")
|
||||
|
Loading…
x
Reference in New Issue
Block a user