Add motherfucking logs..............................

This commit is contained in:
2025-10-10 23:55:01 +02:00
parent 882b9eddfc
commit 6459f97c7b
3 changed files with 130 additions and 48 deletions

View File

@@ -84,50 +84,62 @@ func (o *Orchestrator) Start() {
// refetchAllData fetches data for all characters and checks thresholds
func (o *Orchestrator) refetchAllData() {
logger.Info("Starting data refetch for all characters")
logger.Info("Orchestrator.refetchAllData: Starting data refetch for all characters")
// Get all characters from database
characters, err := o.database.Character().GetAllCharacters()
if err != nil {
logger.Error("Failed to get all characters: %v", err)
logger.Error("Orchestrator.refetchAllData: Failed to get all characters: %v", err)
return
}
logger.Info("Found %d characters to process", len(characters))
logger.Info("Orchestrator.refetchAllData: Found %d characters to process", len(characters))
if len(characters) == 0 {
logger.Info("Orchestrator.refetchAllData: No characters found in database")
return
}
// Process each character
for _, char := range characters {
for i, char := range characters {
logger.Info("Orchestrator.refetchAllData: Processing character %d/%d: %s", i+1, len(characters), char.CharacterName)
o.processCharacter(char)
}
logger.Info("Completed data refetch for all characters")
logger.Info("Orchestrator.refetchAllData: Completed data refetch for all characters")
}
// processCharacter processes a single character's data
func (o *Orchestrator) processCharacter(char types.Character) {
logger.Debug("Processing character: %s", char.CharacterName)
logger.Info("Orchestrator.processCharacter: Starting processing for character: %s (ID: %d)", char.CharacterName, char.ID)
// Get extractors for this character
logger.Info("Orchestrator.processCharacter: Getting extractors for character %s", char.CharacterName)
extractors, err := routes.GetExtractorsForCharacter(o.esiClient, int(char.ID), char.AccessToken)
if err != nil {
logger.Warning("Failed to get extractors for character %s: %v", char.CharacterName, err)
logger.Warning("Orchestrator.processCharacter: Failed to get extractors for character %s: %v", char.CharacterName, err)
return
}
logger.Info("Orchestrator.processCharacter: Got %d extractors for character %s", len(extractors), char.CharacterName)
// Get storage for this character
logger.Info("Orchestrator.processCharacter: Getting storage for character %s", char.CharacterName)
storage, err := routes.GetStorageForCharacter(o.esiClient, int(char.ID), char.AccessToken)
if err != nil {
logger.Warning("Failed to get storage for character %s: %v", char.CharacterName, err)
logger.Warning("Orchestrator.processCharacter: Failed to get storage for character %s: %v", char.CharacterName, err)
return
}
logger.Info("Orchestrator.processCharacter: Got %d storage facilities for character %s", len(storage), char.CharacterName)
// Check storage thresholds
logger.Info("Orchestrator.processCharacter: Checking storage thresholds for character %s", char.CharacterName)
o.checkStorageThresholds(char.CharacterName, storage)
// Update expiry timers for extractors
logger.Info("Orchestrator.processCharacter: Updating expiry timers for character %s", char.CharacterName)
o.updateExpiryTimers(char.CharacterName, extractors)
logger.Debug("Completed processing character: %s", char.CharacterName)
logger.Info("Orchestrator.processCharacter: Completed processing for character %s", char.CharacterName)
}
// checkStorageThresholds checks storage utilization against configured thresholds