From 575c39c3f19152a61ba6c75b10652e1316bb8644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20Dahl=C3=A9n?= <85930202+kickster97@users.noreply.github.com> Date: Mon, 11 Dec 2023 08:24:08 +0100 Subject: [PATCH] only log if the permission is changed (#605) --- src/lavinmq/user_store.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lavinmq/user_store.cr b/src/lavinmq/user_store.cr index fb10f93bef..7f02ef50c9 100644 --- a/src/lavinmq/user_store.cr +++ b/src/lavinmq/user_store.cr @@ -45,9 +45,11 @@ module LavinMQ def add_permission(user, vhost, config, read, write) perm = {config: config, read: read, write: write} + unless perm == @users[user].permissions[vhost] + Log.info { "Updated permissions for user=#{user} on vhost=#{vhost}" } + end @users[user].permissions[vhost] = perm @users[user].invalidate_acl_caches - Log.info { "Updated permissions for user=#{user} on vhost=#{vhost}" } save! perm end