forked from hans/Nominatim
restore the tokenizer directory when missing
Automatically repopulate the tokenizer/ directory with the PHP stub and the postgresql module, when the directory is missing. This allows to switch working directories and in particular run the service from a different maschine then where it was installed. Users still need to make sure that .env files are set up correctly or they will shoot themselves in the foot. See #2515.
This commit is contained in:
@@ -78,8 +78,8 @@ def get_tokenizer_for_db(config):
|
||||
"""
|
||||
basedir = config.project_dir / 'tokenizer'
|
||||
if not basedir.is_dir():
|
||||
LOG.fatal("Cannot find tokenizer data in '%s'.", basedir)
|
||||
raise UsageError('Cannot initialize tokenizer.')
|
||||
# Directory will be repopulated by tokenizer below.
|
||||
basedir.mkdir()
|
||||
|
||||
with connect(config.get_libpq_dsn()) as conn:
|
||||
name = properties.get_property(conn, 'tokenizer')
|
||||
|
||||
Reference in New Issue
Block a user