mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Use system_time/1 instead of monotonic_time/1
The value of monotonic_time/1 may differ significantly between nodes in a cluster due to different erlang:time_offset/0 values. Thanks to Christoph Scholz for spotting this
This commit is contained in:
parent
6c0d6f0774
commit
80b7d50628
@ -744,7 +744,7 @@ get_room_disco_item({Name, Host, Pid},
|
|||||||
{get_disco_item, Filter, JID, Lang}) ->
|
{get_disco_item, Filter, JID, Lang}) ->
|
||||||
RoomJID = jid:make(Name, Host),
|
RoomJID = jid:make(Name, Host),
|
||||||
Timeout = 100,
|
Timeout = 100,
|
||||||
Time = erlang:monotonic_time(millisecond),
|
Time = erlang:system_time(millisecond),
|
||||||
Query1 = {get_disco_item, Filter, JID, Lang, Time+Timeout},
|
Query1 = {get_disco_item, Filter, JID, Lang, Time+Timeout},
|
||||||
try p1_fsm:sync_send_all_state_event(Pid, Query1, Timeout) of
|
try p1_fsm:sync_send_all_state_event(Pid, Query1, Timeout) of
|
||||||
{item, Desc} ->
|
{item, Desc} ->
|
||||||
|
@ -521,7 +521,7 @@ handle_sync_event({get_disco_item, Filter, JID, Lang, Time}, _From, StateName, S
|
|||||||
false ->
|
false ->
|
||||||
false
|
false
|
||||||
end,
|
end,
|
||||||
CurrentTime = erlang:monotonic_time(millisecond),
|
CurrentTime = erlang:system_time(millisecond),
|
||||||
if CurrentTime < Time ->
|
if CurrentTime < Time ->
|
||||||
{reply, Reply, StateName, StateData};
|
{reply, Reply, StateName, StateData};
|
||||||
true ->
|
true ->
|
||||||
|
Loading…
Reference in New Issue
Block a user