sistemato il timer di uscita.
prima di uscire attende che tutti i processi running abbiano finito.
This commit is contained in:
parent
699a3aaae4
commit
e258d8951c
6 changed files with 42 additions and 19 deletions
|
@ -17,7 +17,7 @@ func producer(consume chan produced, done chan bool) {
|
|||
conn := dbs.rdb.Get()
|
||||
defer conn.Close()
|
||||
|
||||
for {
|
||||
for loop {
|
||||
|
||||
start := time.Now()
|
||||
// estrae un userid dalla lista degli utenti che hanno fatto login
|
||||
|
@ -32,7 +32,9 @@ func producer(consume chan produced, done chan bool) {
|
|||
log.Printf("LLINDEX empty: %v\n\r", err)
|
||||
fmt.Printf("LLINDEX empty: %v\n\r", err)
|
||||
}
|
||||
loop = false
|
||||
done <- true
|
||||
break
|
||||
}
|
||||
|
||||
// estrae tutti i login dell'utente "user"
|
||||
|
@ -46,7 +48,9 @@ func producer(consume chan produced, done chan bool) {
|
|||
log.Printf("LRANGE: %s - %d\n\r", user, len(logs))
|
||||
}
|
||||
|
||||
fmt.Printf("PROD: user=%s in %v - conn=%d\n\r", user, time.Since(start), dbs.rdb.ActiveCount())
|
||||
if opts.Debug {
|
||||
fmt.Printf("PROD: user=%s in %v - conn=%d\n\r", user, time.Since(start), dbs.rdb.ActiveCount())
|
||||
}
|
||||
|
||||
consume <- produced{
|
||||
user: user,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue