Rename extractPlayerAchievementsFromFile to loadAchievements and update related logging messages

This commit is contained in:
2025-05-21 11:48:28 +02:00
parent 5e3fb568ae
commit 7c2debf051

View File

@@ -76,13 +76,13 @@ func main() {
var wgPass1 sync.WaitGroup var wgPass1 sync.WaitGroup
for _, match := range matches { for _, match := range matches {
wgPass1.Add(1) wgPass1.Add(1)
go extractPlayerAchievementsFromFile(filepath.Join(cleanedRoot, match), &wgPass1) go loadAchievements(filepath.Join(cleanedRoot, match), &wgPass1)
} }
wgPass1.Wait() wgPass1.Wait()
logger.Info("Finished Pass 1: Extracted data for %d unique players globally from %d files.", len(allPlayerNamesGlobal), len(matches)) logger.Info("Finished Pass 1: Loaded %d unique players from %d files.", len(allPlayerNamesGlobal), len(matches))
if *debug { if *debug {
globalDataMutex.Lock() globalDataMutex.Lock()
logger.Debug("Total achievements collected globally: %d", countTotalAchievements(allPlayersAchievementsGlobal)) logger.Debug("Total achievements loaded globally: %d", countTotalAchievements(allPlayersAchievementsGlobal))
globalDataMutex.Unlock() globalDataMutex.Unlock()
} }
@@ -150,8 +150,7 @@ func countTotalAchievements(achMap map[string][]NSQMessage) int {
return count return count
} }
// extractPlayerAchievementsFromFile is for Pass 1 func loadAchievements(path string, wg *sync.WaitGroup) {
func extractPlayerAchievementsFromFile(path string, wg *sync.WaitGroup) {
log := logger.Default.WithPrefix(path) log := logger.Default.WithPrefix(path)
log.Info("Extracting achievements") log.Info("Extracting achievements")
defer wg.Done() defer wg.Done()