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
for _, match := range matches {
wgPass1.Add(1)
go extractPlayerAchievementsFromFile(filepath.Join(cleanedRoot, match), &wgPass1)
go loadAchievements(filepath.Join(cleanedRoot, match), &wgPass1)
}
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 {
globalDataMutex.Lock()
logger.Debug("Total achievements collected globally: %d", countTotalAchievements(allPlayersAchievementsGlobal))
logger.Debug("Total achievements loaded globally: %d", countTotalAchievements(allPlayersAchievementsGlobal))
globalDataMutex.Unlock()
}
@@ -150,8 +150,7 @@ func countTotalAchievements(achMap map[string][]NSQMessage) int {
return count
}
// extractPlayerAchievementsFromFile is for Pass 1
func extractPlayerAchievementsFromFile(path string, wg *sync.WaitGroup) {
func loadAchievements(path string, wg *sync.WaitGroup) {
log := logger.Default.WithPrefix(path)
log.Info("Extracting achievements")
defer wg.Done()