- Remove all CachedQueries usage throughout the codebase - Replace with direct Packets module calls - Delete CachedQueries module entirely - Rename get_recent_packets_optimized to get_recent_packets - Add has_weather_packets? function to Packets module - Fix duplicate function definitions - Update all test references to use new function names This simplifies the codebase by removing the caching layer and eliminates the database ownership errors in tests. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
14 lines
703 B
Elixir
14 lines
703 B
Elixir
defmodule Aprsme.PacketsBehaviour do
|
|
@moduledoc """
|
|
Behaviour for Packets module to allow mocking in tests
|
|
"""
|
|
|
|
@callback get_historical_packet_count(map()) :: non_neg_integer()
|
|
@callback stream_packets_for_replay(map()) :: Enumerable.t()
|
|
@callback get_packets_for_replay(map()) :: list()
|
|
@callback get_recent_packets(map()) :: list()
|
|
@callback get_nearby_stations(float(), float(), String.t() | nil, map()) :: list()
|
|
@callback get_weather_packets(String.t(), DateTime.t(), DateTime.t(), map()) :: list()
|
|
@callback clean_old_packets() :: {:ok, non_neg_integer()} | {:error, any()}
|
|
@callback clean_packets_older_than(pos_integer()) :: {:ok, non_neg_integer()} | {:error, any()}
|
|
end
|