backend: don't regenerate files if config doesn't change

This commit is contained in:
nemunaire 2017-01-16 13:12:57 +01:00 committed by nemunaire
parent 95f813447c
commit 9e5ab64589

View File

@ -44,17 +44,21 @@ func watchsubdir(watcher *fsnotify.Watcher, pathname string) error {
} }
func reloadSettings(config settings.FICSettings) { func reloadSettings(config settings.FICSettings) {
fic.PartialValidation = config.PartialValidation if fic.PartialValidation != config.PartialValidation || fic.UnlockedChallenges != !config.EnableExerciceDepend || fic.FirstBlood != config.FirstBlood || fic.SubmissionCostBase != config.SubmissionCostBase {
fic.UnlockedChallenges = !config.EnableExerciceDepend fic.PartialValidation = config.PartialValidation
fic.UnlockedChallenges = !config.EnableExerciceDepend
fic.FirstBlood = config.FirstBlood fic.FirstBlood = config.FirstBlood
fic.SubmissionCostBase = config.SubmissionCostBase fic.SubmissionCostBase = config.SubmissionCostBase
log.Println("Generating files...") log.Println("Generating files...")
go func() { go func() {
genAll() genAll()
log.Println("Full generation done") log.Println("Full generation done")
}() }()
} else {
log.Println("No change found. Skipping regeneration.")
}
} }
func main() { func main() {