backend: don't regenerate files if config doesn't change
This commit is contained in:
parent
95f813447c
commit
9e5ab64589
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user