modificato il conteggio dei logins gestiti
This commit is contained in:
parent
8228f63fff
commit
58518c4b6a
4 changed files with 37 additions and 40 deletions
25
producer.go
25
producer.go
|
@ -15,6 +15,12 @@ type produced struct {
|
|||
logins []string
|
||||
}
|
||||
|
||||
type loginsList struct {
|
||||
user string
|
||||
logins []string
|
||||
err bool
|
||||
}
|
||||
|
||||
func producer() {
|
||||
conn := dbs.rdb.Get()
|
||||
defer conn.Close()
|
||||
|
@ -54,11 +60,6 @@ func producer() {
|
|||
tipo: "user",
|
||||
val: 1,
|
||||
}
|
||||
wg.Add(1)
|
||||
counter <- Counterchan{
|
||||
tipo: "wg",
|
||||
val: 1,
|
||||
}
|
||||
|
||||
if opts.Debug {
|
||||
fmt.Printf("PROD: %+v\n", time.Since(start))
|
||||
|
@ -68,9 +69,21 @@ func producer() {
|
|||
log.Printf("PROD: %s - %d\n", user, len(logs))
|
||||
}
|
||||
|
||||
consume <- produced{
|
||||
wg.Add(1)
|
||||
counter <- Counterchan{
|
||||
tipo: "wg",
|
||||
val: 1,
|
||||
}
|
||||
|
||||
counter <- Counterchan{
|
||||
tipo: "log",
|
||||
val: len(logs),
|
||||
}
|
||||
|
||||
consume <- loginsList{
|
||||
user: user,
|
||||
logins: logs,
|
||||
err: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue