From eb10ec15e254e703606970fea2f9b7b48e980506 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Thu, 15 Jun 2017 17:03:22 +0200 Subject: [PATCH] Added user count --- jobs/avatars/main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jobs/avatars/main.go b/jobs/avatars/main.go index 99a63fa4..dbd707af 100644 --- a/jobs/avatars/main.go +++ b/jobs/avatars/main.go @@ -33,6 +33,7 @@ func main() { // Log avatarLog.AddOutput(log.File("logs/avatar.log")) + defer avatarLog.Flush() // Define the avatar sources avatarSources = []AvatarSource{ @@ -75,14 +76,19 @@ func main() { } // Stream of all users - users, _ := arn.AllUsers() + users, _ := arn.FilterUsers(func(user *arn.User) bool { + return true + }) + + // Log user count + println(len(users), "users") // Worker queue usersQueue := make(chan *arn.User) StartWorkers(usersQueue, Work) // We'll send each user to one of the worker threads - for user := range users { + for _, user := range users { usersQueue <- user }