Skip to content

Commit

Permalink
allow redis server to be something other localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
wllgrnt committed Oct 6, 2023
1 parent 0787d43 commit 07f26cf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion object_database/frontends/service_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def startServiceManagerProcess(
sslPath=None,
proxyPort=None,
redisPort=None,
redisHost=None,
):
if not verbose:
kwargs = dict(stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
Expand Down Expand Up @@ -102,6 +103,10 @@ def startServiceManagerProcess(
cmd.append("--redis_port")
cmd.append(str(redisPort))

if redisHost is not None:
cmd.append("--redis_host")
cmd.append(redisHost)

if logDir:
logsPath = os.path.join(tempDirectoryName, "logs")
cmd.extend(["--logdir", logsPath])
Expand Down Expand Up @@ -273,6 +278,7 @@ def main(argv=None):
help="path to (self-signed) SSL certificate",
)
parser.add_argument("--redis_port", type=int, default=None, required=False)
parser.add_argument("--redis_host", type=str, default="localhost", required=False)
parser.add_argument("--fd-limit", type=int, default=4096, required=False)

parser.add_argument("--max_gb_ram", type=float, default=None, required=False)
Expand Down Expand Up @@ -400,7 +406,7 @@ def shutdownCleanly(signalNumber, frame):
databaseServer = TcpServer(
ownHostname,
parsedArgs.port,
RedisPersistence(port=parsedArgs.redis_port)
RedisPersistence(host=parsedArgs.redis_host, port=parsedArgs.redis_port)
if parsedArgs.redis_port is not None
else InMemoryPersistence(),
ssl_context=ssl_ctx,
Expand Down

0 comments on commit 07f26cf

Please sign in to comment.