Skip to content

Commit

Permalink
Fix timestamp format
Browse files Browse the repository at this point in the history
  • Loading branch information
terry-xiaoyu committed Apr 16, 2020
1 parent 33fcba3 commit 27ca376
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/emqx_rule_actions.erl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ on_action_create_republish(Id, #{<<"target_topic">> := TargetTopic, <<"target_qo
?LOG(error, "[republish] recursively republish detected, msg topic: ~p, target topic: ~p",
[Topic, TargetTopic]),
error({recursive_republish, Envs});
(Selected, #{qos := QoS, flags := Flags}) ->
(Selected, _Envs = #{qos := QoS, flags := Flags, timestamp := Timestamp}) ->
?LOG(debug, "[republish] republish to: ~p, Payload: ~p",
[TargetTopic, Selected]),
emqx_broker:safe_publish(
Expand All @@ -141,7 +141,7 @@ on_action_create_republish(Id, #{<<"target_topic">> := TargetTopic, <<"target_qo
flags = Flags,
topic = emqx_rule_utils:proc_tmpl(TopicTks, Selected),
payload = emqx_rule_utils:proc_tmpl(PayloadTks, Selected),
timestamp = erlang:timestamp()
timestamp = Timestamp
})
);
%% in case this is not a "message.publish" request
Expand All @@ -157,7 +157,7 @@ on_action_create_republish(Id, #{<<"target_topic">> := TargetTopic, <<"target_qo
headers = #{republish_by => Id},
topic = emqx_rule_utils:proc_tmpl(TopicTks, Selected),
payload = emqx_rule_utils:proc_tmpl(PayloadTks, Selected),
timestamp = erlang:timestamp()
timestamp = erlang:system_time(millisecond)
})
end.

Expand Down

0 comments on commit 27ca376

Please sign in to comment.