backend: multithread generation

This commit is contained in:
nemunaire 2019-07-11 19:52:13 +02:00
commit 2b75287d16
7 changed files with 115 additions and 71 deletions

View file

@ -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)
}