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,6 +44,7 @@ func watchsubdir(watcher *fsnotify.Watcher, pathname string) error {
} }
func reloadSettings(config settings.FICSettings) { func reloadSettings(config settings.FICSettings) {
if fic.PartialValidation != config.PartialValidation || fic.UnlockedChallenges != !config.EnableExerciceDepend || fic.FirstBlood != config.FirstBlood || fic.SubmissionCostBase != config.SubmissionCostBase {
fic.PartialValidation = config.PartialValidation fic.PartialValidation = config.PartialValidation
fic.UnlockedChallenges = !config.EnableExerciceDepend fic.UnlockedChallenges = !config.EnableExerciceDepend
@ -55,6 +56,9 @@ func reloadSettings(config settings.FICSettings) {
genAll() genAll()
log.Println("Full generation done") log.Println("Full generation done")
}() }()
} else {
log.Println("No change found. Skipping regeneration.")
}
} }
func main() { func main() {