diff --git a/chat_archiver/chat_archiver/main.py b/chat_archiver/chat_archiver/main.py index afd7065..b80b856 100644 --- a/chat_archiver/chat_archiver/main.py +++ b/chat_archiver/chat_archiver/main.py @@ -399,12 +399,14 @@ def merge_messages(left, right): return result -def main(channel, nick, oauth_token_path, base_dir='/mnt'): +def main(channel, nick, oauth_token_path, base_dir='/mnt', name=None): with open(oauth_token_path) as f: oauth_token = f.read() # To ensure uniqueness even if multiple instances are running on the same host, # also include our pid - name = "{}.{}".format(socket.gethostname(), os.getpid()) + if name is None: + name = socket.gethostname() + name = "{}.{}".format(name, os.getpid()) stopping = gevent.event.Event() gevent.signal_handler(signal.SIGTERM, stopping.set) diff --git a/docker-compose.jsonnet b/docker-compose.jsonnet index 78dbb73..ebb5aa9 100644 --- a/docker-compose.jsonnet +++ b/docker-compose.jsonnet @@ -454,7 +454,7 @@ [if $.enabled.chat_archiver then "chat_archiver"]: { image: $.get_image("chat_archiver"), restart: "always", - command: [$.chat_archiver.channel, $.chat_archiver.user, "/token"], + command: [$.chat_archiver.channel, $.chat_archiver.user, "/token", "--name", $.localhost], volumes: ["%s:/mnt" % $.segments_path, "%s:/token" % $.chat_archiver.token_path], },