backend: rely on configuration instead of started file to determine if the challenge is launched or not

This commit is contained in:
nemunaire 2019-01-17 16:48:45 +01:00
parent af1cecd3ce
commit 75463dcebb
2 changed files with 3 additions and 9 deletions

View file

@ -12,14 +12,6 @@ import (
"srs.epita.fr/fic-server/libfic"
)
// Check if the challenge is started or not
func isStarted() bool {
if _, err := os.Stat(path.Join(SubmissionDir, "started")); os.IsNotExist(err) {
return false
}
return true
}
// Generate my.json and wait.json for a given team
func genTeamMyFile(team fic.Team) error {
dirPath := path.Join(TeamsDir, fmt.Sprintf("%d", team.Id))
@ -39,7 +31,7 @@ func genTeamMyFile(team fic.Team) error {
}
// Speed up generation when challenge is started
if !isStarted() {
if !ChStarted {
if my, err := fic.MyJSONTeam(&team, false); err != nil {
return err
} else if j, err := json.Marshal(my); err != nil {