mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-07 16:25:37 +00:00
Merge pull request #474 from guarzo/guarzo/devfix
fix: update broken links and remove verbose logging
This commit is contained in:
@@ -188,7 +188,6 @@ defmodule WandererApp.Character.Tracker do
|
||||
|
||||
_ ->
|
||||
# Monitor cache for potential evictions before ESI call
|
||||
log_cache_stats("character_online_check", character_id, "online_forbidden")
|
||||
|
||||
case WandererApp.Esi.get_character_online(eve_id,
|
||||
access_token: access_token,
|
||||
@@ -681,7 +680,6 @@ defmodule WandererApp.Character.Tracker do
|
||||
|
||||
_ ->
|
||||
# Monitor cache for potential evictions before ESI call
|
||||
log_cache_stats("character_location_check", character_id, "location_forbidden")
|
||||
|
||||
case WandererApp.Esi.get_character_location(eve_id,
|
||||
access_token: access_token,
|
||||
@@ -1382,50 +1380,6 @@ defmodule WandererApp.Character.Tracker do
|
||||
end
|
||||
end
|
||||
|
||||
# Add cache monitoring for eviction detection
|
||||
defp log_cache_stats(operation, character_id, cache_key) do
|
||||
try do
|
||||
# Check if critical cache entries are missing (could indicate eviction)
|
||||
critical_keys = [
|
||||
"character:#{character_id}:last_online_time",
|
||||
"character:#{character_id}:online_forbidden",
|
||||
"character:#{character_id}:location_forbidden",
|
||||
"character:#{character_id}:ship_forbidden"
|
||||
]
|
||||
|
||||
missing_keys =
|
||||
Enum.filter(critical_keys, fn key ->
|
||||
not WandererApp.Cache.has_key?(key)
|
||||
end)
|
||||
|
||||
# Alert if multiple cache keys are missing
|
||||
if length(missing_keys) > 2 do
|
||||
Logger.warning("CACHE_EVICTION_SUSPECTED: Multiple critical cache keys missing",
|
||||
operation: operation,
|
||||
character_id: character_id,
|
||||
cache_key: cache_key,
|
||||
missing_keys: missing_keys,
|
||||
missing_count: length(missing_keys)
|
||||
)
|
||||
|
||||
# Emit telemetry
|
||||
:telemetry.execute(
|
||||
[:wanderer_app, :cache, :eviction_suspected],
|
||||
%{
|
||||
missing_count: length(missing_keys)
|
||||
},
|
||||
%{
|
||||
operation: operation,
|
||||
character_id: character_id
|
||||
}
|
||||
)
|
||||
end
|
||||
rescue
|
||||
# Don't fail character tracking if cache monitoring fails
|
||||
_ -> :ok
|
||||
end
|
||||
end
|
||||
|
||||
# Telemetry handler for database pool monitoring
|
||||
def handle_pool_query(_event_name, measurements, metadata, _config) do
|
||||
queue_time = measurements[:queue_time]
|
||||
|
||||
@@ -792,7 +792,10 @@ defmodule WandererApp.Esi.ApiClient do
|
||||
expires_at_datetime = DateTime.from_unix!(expires_at)
|
||||
time_since_expiry = DateTime.diff(DateTime.utc_now(), expires_at_datetime, :second)
|
||||
|
||||
Logger.info("TOKEN_REFRESH_SUCCESS: Character token refreshed successfully",
|
||||
Logger.debug(
|
||||
fn ->
|
||||
"TOKEN_REFRESH_SUCCESS: Character token refreshed successfully"
|
||||
end,
|
||||
character_id: character_id,
|
||||
time_since_expiry_seconds: time_since_expiry,
|
||||
new_expires_at: token.expires_at
|
||||
|
||||
@@ -112,7 +112,10 @@ defmodule WandererApp.Kills.Client do
|
||||
end
|
||||
|
||||
def handle_info(:connect, state) do
|
||||
Logger.info("[Client] Initiating connection attempt (retry count: #{state.retry_count})")
|
||||
Logger.debug(fn ->
|
||||
"[Client] Initiating connection attempt (retry count: #{state.retry_count})"
|
||||
end)
|
||||
|
||||
state = cancel_retry(state)
|
||||
new_state = attempt_connection(%{state | connecting: true})
|
||||
{:noreply, new_state}
|
||||
@@ -214,9 +217,9 @@ defmodule WandererApp.Kills.Client do
|
||||
state
|
||||
|
||||
:needs_reconnect ->
|
||||
Logger.warning(
|
||||
Logger.debug(fn ->
|
||||
"[Client] Connection unhealthy, triggering reconnect (retry count: #{state.retry_count})"
|
||||
)
|
||||
end)
|
||||
|
||||
# Don't reset retry count during health check failures
|
||||
if state.connected or state.connecting do
|
||||
@@ -228,9 +231,9 @@ defmodule WandererApp.Kills.Client do
|
||||
end
|
||||
|
||||
:needs_reconnect_with_timestamp ->
|
||||
Logger.warning(
|
||||
Logger.debug(fn ->
|
||||
"[Client] Health check triggering reconnect (retry count: #{state.retry_count})"
|
||||
)
|
||||
end)
|
||||
|
||||
new_state = %{state | last_health_reconnect_attempt: System.system_time(:millisecond)}
|
||||
|
||||
@@ -552,9 +555,9 @@ defmodule WandererApp.Kills.Client do
|
||||
|
||||
# Check if we haven't received a message in the configured timeout
|
||||
System.system_time(:millisecond) - last_msg_time > @message_timeout ->
|
||||
Logger.warning(
|
||||
Logger.debug(fn ->
|
||||
"[Client] Health check: No messages received for 15+ minutes, reconnecting"
|
||||
)
|
||||
end)
|
||||
|
||||
:needs_reconnect
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%{
|
||||
title: "Guide: Systems and Connections API",
|
||||
author: "Wanderer Team",
|
||||
cover_image_uri: "/images/news/03-06-systems/api-endpoints.png",
|
||||
cover_image_uri: "/images/news/05-07-systems/api-endpoints.png",
|
||||
tags: ~w(api map systems connections documentation),
|
||||
description: "Detailed guide for Wanderer's systems and connections API endpoints, including batch operations, updates, and deletions."
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%{
|
||||
title: "API Modernization: JSON:API v1 and Enhanced Developer Experience",
|
||||
author: "Wanderer Team",
|
||||
cover_image_uri: "/images/news/01-15-api-modernization/api-hero.png",
|
||||
cover_image_uri: "/images/news/07-15-api-modernization/api-hero.png",
|
||||
tags: ~w(api json-api v1 modernization developer-experience backwards-compatibility ash-framework),
|
||||
description: "Introducing Wanderer's new JSON:API v1 endpoints with enhanced developer experience, comprehensive versioning, and enterprise-grade security - all while maintaining 100% backward compatibility."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user