forked from mediatum/mediatum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.py
54 lines (42 loc) · 1.7 KB
/
start.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"""
mediatum - a multimedia content repository
Copyright (C) 2007 Arne Seifert <[email protected]>
Copyright (C) 2007 Matthias Kramm <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import sys
from core import config, webconfig, init
from core import athana
init.full_init()
### init all web components
webconfig.initContexts()
### scheduler thread
import core.schedules
try:
core.schedules.startThread()
except:
msg = "Error starting scheduler thread: %s %s" % (str(sys.exc_info()[0]), str(sys.exc_info()[1]))
core.schedules.OUT(msg, logger='backend', print_stdout=True, level='error')
### full text search thread
if config.get("config.searcher", "").startswith("fts"):
import core.search.ftsquery
core.search.ftsquery.startThread()
else:
import core.search.query
core.search.query.startThread()
### start main web server, Z.39.50 and FTP, if configured
if config.get('z3950.activate', '').lower() == 'true':
z3950port = int(config.get("z3950.port", "2021"))
else:
z3950port = None
athana.setThreads(int(config.get("host.threads", "8")))
athana.run(int(config.get("host.port", "8081")), z3950port)