backend: don't regenerate files if config doesn't change
This commit is contained in:
parent
67f27d3d8b
commit
8fd2cd66c1
1 changed files with 13 additions and 9 deletions
|
@ -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() {
|
||||||
|
|
Reference in a new issue