Przeglądaj źródła

fix: update the will message timestamp when it is ready to publish

firest 2 lat temu
rodzic
commit
dcd4640a57
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      apps/emqx/src/emqx_channel.erl

+ 2 - 1
apps/emqx/src/emqx_channel.erl

@@ -2146,7 +2146,8 @@ publish_will_msg(
             ok;
         false ->
             NMsg = emqx_mountpoint:mount(MountPoint, Msg),
-            _ = emqx_broker:publish(NMsg),
+            NMsg2 = NMsg#message{timestamp = erlang:system_time(millisecond)},
+            _ = emqx_broker:publish(NMsg2),
             ok
     end.