backend: rely on configuration instead of started file to determine if the challenge is launched or not
This commit is contained in:
parent
af1cecd3ce
commit
75463dcebb
2 changed files with 3 additions and 9 deletions
|
@ -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 {
|
||||
|
|
Reference in a new issue