mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-28 15:08:49 +03:00
Change relative db paths to absolute paths in case we daemonize.
This commit is contained in:
parent
e37de2aef3
commit
e4061383b8
1 changed files with 9 additions and 2 deletions
|
@ -34,6 +34,7 @@ import argparse
|
||||||
import logging
|
import logging
|
||||||
import logging.config
|
import logging.config
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
import os
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -234,9 +235,15 @@ def setup():
|
||||||
|
|
||||||
verbosity = int(args.verbose) if args.verbose else None
|
verbosity = int(args.verbose) if args.verbose else None
|
||||||
|
|
||||||
|
# Because if/when we daemonize we change to root dir.
|
||||||
|
db_name = os.path.abspath(args.db)
|
||||||
|
log_file = args.log_file
|
||||||
|
if log_file:
|
||||||
|
log_file = os.path.abspath(log_file)
|
||||||
|
|
||||||
setup_logging(
|
setup_logging(
|
||||||
verbosity=verbosity,
|
verbosity=verbosity,
|
||||||
filename=args.log_file,
|
filename=log_file,
|
||||||
config_path=args.log_config,
|
config_path=args.log_config,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -244,7 +251,7 @@ def setup():
|
||||||
|
|
||||||
hs = SynapseHomeServer(
|
hs = SynapseHomeServer(
|
||||||
args.host,
|
args.host,
|
||||||
db_name=args.db
|
db_name=db_name
|
||||||
)
|
)
|
||||||
|
|
||||||
# This object doesn't need to be saved because it's set as the handler for
|
# This object doesn't need to be saved because it's set as the handler for
|
||||||
|
|
Loading…
Reference in a new issue