chat-archiver: pass in node name

instead of using container hostname
pull/300/head
Mike Lang 2 years ago committed by Mike Lang
parent a48beab576
commit 4cfc362f76

@ -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)

@ -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],
},

Loading…
Cancel
Save