backend: multithread generation
This commit is contained in:
parent
3bcac39f5f
commit
2b75287d16
7 changed files with 115 additions and 71 deletions
|
|
@ -3,15 +3,15 @@ package main
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
)
|
||||
|
||||
type askOpenHint struct {
|
||||
HintId int64 `json:"id"`
|
||||
HintId int64 `json:"id"`
|
||||
}
|
||||
|
||||
func treatOpeningHint(pathname string, team fic.Team) {
|
||||
|
|
@ -42,13 +42,8 @@ func treatOpeningHint(pathname string, team fic.Team) {
|
|||
log.Println("[WRN] Unable to create event:", err)
|
||||
}
|
||||
|
||||
|
||||
if err = genTeamMyFile(team); err != nil {
|
||||
log.Println("my-", team.Id, ".json generation error: ", err)
|
||||
}
|
||||
if err = genEventsFile(); err != nil {
|
||||
log.Println("events.json generation error: ", err)
|
||||
}
|
||||
genTeamQueue <- &team
|
||||
appendGenQueue(genStruct{Type: GenEvents})
|
||||
if err = os.Remove(pathname); err != nil {
|
||||
log.Println("[ERR]", err)
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue