mirror of
https://github.com/netfun2000/hipudding-teslamate.git
synced 2026-02-27 09:44:28 +08:00
Unify wording
This commit is contained in:
@@ -276,7 +276,7 @@ defmodule TeslaMate.Vehicles.Vehicle do
|
||||
drive_states = %{now: vehicle.drive_state, last: data.last_response.drive_state}
|
||||
|
||||
Logger.warning(
|
||||
"Discarded outdated fetch result: #{inspect(drive_states, pretty: true)}",
|
||||
"Discarded stale fetch result: #{inspect(drive_states, pretty: true)}",
|
||||
car_id: data.car.id
|
||||
)
|
||||
|
||||
@@ -397,10 +397,10 @@ defmodule TeslaMate.Vehicles.Vehicle do
|
||||
_ -> nil
|
||||
end
|
||||
|
||||
outdated_stream_data? = t0 != nil and DateTime.compare(t0, stream_data.time) == :gt
|
||||
stale_stream_data? = t0 != nil and DateTime.compare(t0, stream_data.time) == :gt
|
||||
|
||||
case stream_data do
|
||||
%Stream.Data{} when outdated_stream_data? ->
|
||||
%Stream.Data{} when stale_stream_data? ->
|
||||
Logger.warn("Received stale stream data: #{inspect(stream_data)}", car_id: data.car.id)
|
||||
:keep_state_and_data
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ defmodule TeslaMate.Vehicles.Vehicle.StreamingTest do
|
||||
assert_receive :continue?
|
||||
refute_receive _
|
||||
end) =~ """
|
||||
[warn] Discarded outdated fetch result: %{
|
||||
[warn] Discarded stale fetch result: %{
|
||||
last: %TeslaApi.Vehicle.State.Drive{
|
||||
gps_as_of: nil,
|
||||
heading: 120,
|
||||
@@ -281,11 +281,10 @@ defmodule TeslaMate.Vehicles.Vehicle.StreamingTest do
|
||||
@tag :capture_log
|
||||
test "discards stale stream data", %{test: name} do
|
||||
now = DateTime.utc_now()
|
||||
now_ts = DateTime.to_unix(now, :millisecond)
|
||||
|
||||
events = [
|
||||
{:ok, online_event()},
|
||||
{:ok, online_event(drive_state: %{timestamp: now_ts})},
|
||||
{:ok, online_event(drive_state: %{timestamp: DateTime.to_unix(now, :millisecond)})},
|
||||
fn -> Process.sleep(10_000) end
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user