backend: multithread generation
This commit is contained in:
parent
3bcac39f5f
commit
2b75287d16
7 changed files with 115 additions and 71 deletions
|
|
@ -3,8 +3,8 @@ package main
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"regexp"
|
||||
|
||||
|
|
@ -28,15 +28,11 @@ func treatRename(pathname string, team fic.Team) {
|
|||
if _, err := team.Update(); err != nil {
|
||||
log.Println("[WRN] Unable to change team name:", err)
|
||||
}
|
||||
if err := genTeamMyFile(team); err != nil {
|
||||
log.Println("my-", team.Id, ".json generation error: ", err)
|
||||
}
|
||||
genTeamQueue <- &team
|
||||
if _, err := fic.NewEvent(fmt.Sprintf("Souhaitons bonne chance à l'équipe <strong>%s</strong> qui vient de nous rejoindre !", team.Name), "info"); err != nil {
|
||||
log.Println("[WRN] Unable to create event:", err)
|
||||
}
|
||||
if err := genEventsFile(); err != nil {
|
||||
log.Println("events.json generation error: ", err)
|
||||
}
|
||||
appendGenQueue(genStruct{Type: GenEvents})
|
||||
if err := os.Remove(pathname); err != nil {
|
||||
log.Println("[ERR]", err)
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue