Change timestamps to millisecond
This commit is contained in:
parent
9ba938b9d9
commit
e806a96031
|
@ -105,7 +105,7 @@ init(_) ->
|
|||
{ok, []}.
|
||||
|
||||
handle_event({set_alarm, {AlarmId, AlarmDesc = #alarm{timestamp = undefined}}}, State) ->
|
||||
handle_event({set_alarm, {AlarmId, AlarmDesc#alarm{timestamp = erlang:system_time(second)}}}, State);
|
||||
handle_event({set_alarm, {AlarmId, AlarmDesc#alarm{timestamp = erlang:system_time(millisecond)}}}, State);
|
||||
handle_event({set_alarm, Alarm = {AlarmId, AlarmDesc}}, State) ->
|
||||
?LOG(warning, "New Alarm: ~p, Alarm Info: ~p", [AlarmId, AlarmDesc]),
|
||||
case encode_alarm(Alarm) of
|
||||
|
@ -199,5 +199,5 @@ clear_alarm_(Id) ->
|
|||
set_alarm_history(Id, Desc) ->
|
||||
His = #alarm_history{id = Id,
|
||||
desc = Desc,
|
||||
clear_at = erlang:system_time(second)},
|
||||
clear_at = erlang:system_time(millisecond)},
|
||||
mnesia:dirty_write(?ALARM_HISTORY_TAB, His).
|
||||
|
|
|
@ -1345,7 +1345,7 @@ enrich_assigned_clientid(AckProps, #channel{conninfo = ConnInfo,
|
|||
|
||||
ensure_connected(Channel = #channel{conninfo = ConnInfo,
|
||||
clientinfo = ClientInfo}) ->
|
||||
NConnInfo = ConnInfo#{connected_at => erlang:system_time(second)},
|
||||
NConnInfo = ConnInfo#{connected_at => erlang:system_time(millisecond)},
|
||||
ok = run_hooks('client.connected', [ClientInfo, NConnInfo]),
|
||||
Channel#channel{conninfo = NConnInfo,
|
||||
conn_state = connected
|
||||
|
@ -1422,7 +1422,7 @@ parse_topic_filters(TopicFilters) ->
|
|||
|
||||
ensure_disconnected(Reason, Channel = #channel{conninfo = ConnInfo,
|
||||
clientinfo = ClientInfo}) ->
|
||||
NConnInfo = ConnInfo#{disconnected_at => erlang:system_time(second)},
|
||||
NConnInfo = ConnInfo#{disconnected_at => erlang:system_time(millisecond)},
|
||||
ok = run_hooks('client.disconnected', [ClientInfo, Reason, NConnInfo]),
|
||||
Channel#channel{conninfo = NConnInfo, conn_state = disconnected}.
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ init(#{zone := Zone}, #{receive_maximum := MaxInflight}) ->
|
|||
awaiting_rel = #{},
|
||||
max_awaiting_rel = get_env(Zone, max_awaiting_rel, 100),
|
||||
await_rel_timeout = timer:seconds(get_env(Zone, await_rel_timeout, 300)),
|
||||
created_at = erlang:system_time(second)
|
||||
created_at = erlang:system_time(millisecond)
|
||||
}.
|
||||
|
||||
%% @private init mq
|
||||
|
|
Loading…
Reference in New Issue