Add achievement processing counter and logging in extractPlayerAchievementsFromFile
This commit is contained in:
7
main.go
7
main.go
@@ -183,6 +183,7 @@ func extractPlayerAchievementsFromFile(path string, wg *sync.WaitGroup) {
|
|||||||
var filePlayerAchievements []NSQMessage // Temporary list for this file's achievements
|
var filePlayerAchievements []NSQMessage // Temporary list for this file's achievements
|
||||||
var filePlayerNames = make(map[string]bool) // Temporary set for this file's player names
|
var filePlayerNames = make(map[string]bool) // Temporary set for this file's player names
|
||||||
|
|
||||||
|
counter := 0
|
||||||
playersTable.ForEach(func(playerNameLua lua.LValue, playerAchievementsLua lua.LValue) {
|
playersTable.ForEach(func(playerNameLua lua.LValue, playerAchievementsLua lua.LValue) {
|
||||||
currentPlayerName := playerNameLua.String()
|
currentPlayerName := playerNameLua.String()
|
||||||
filePlayerNames[currentPlayerName] = true // Track name
|
filePlayerNames[currentPlayerName] = true // Track name
|
||||||
@@ -228,8 +229,14 @@ func extractPlayerAchievementsFromFile(path string, wg *sync.WaitGroup) {
|
|||||||
if currentAchievement.ID != "" { // Ensure we have at least an ID before adding
|
if currentAchievement.ID != "" { // Ensure we have at least an ID before adding
|
||||||
filePlayerAchievements = append(filePlayerAchievements, currentAchievement)
|
filePlayerAchievements = append(filePlayerAchievements, currentAchievement)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
counter++
|
||||||
|
if counter%2000 == 0 {
|
||||||
|
log.Info("Processed %d achievements", counter)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
log.Info("Processed %d achievements", counter)
|
||||||
|
|
||||||
if len(filePlayerAchievements) > 0 || len(filePlayerNames) > 0 {
|
if len(filePlayerAchievements) > 0 || len(filePlayerNames) > 0 {
|
||||||
globalDataMutex.Lock()
|
globalDataMutex.Lock()
|
||||||
|
|||||||
Reference in New Issue
Block a user