backend: multithread generation
This commit is contained in:
parent
3bcac39f5f
commit
2b75287d16
7 changed files with 115 additions and 71 deletions
|
|
@ -2,15 +2,15 @@ package main
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
)
|
||||
|
||||
type wantChoices struct {
|
||||
FlagId int64 `json:"id"`
|
||||
FlagId int64 `json:"id"`
|
||||
}
|
||||
|
||||
func treatWantChoices(pathname string, team fic.Team) {
|
||||
|
|
@ -34,9 +34,7 @@ func treatWantChoices(pathname string, team fic.Team) {
|
|||
} else if err = team.DisplayChoices(flag); err != nil {
|
||||
log.Println("[ERR]", err)
|
||||
} else {
|
||||
if err = genTeamMyFile(team); err != nil {
|
||||
log.Println("my-", team.Id, ".json generation error: ", err)
|
||||
}
|
||||
genTeamQueue <- &team
|
||||
if err = os.Remove(pathname); err != nil {
|
||||
log.Println("[ERR]", err)
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue