backend: don't regenerate files if config doesn't change
This commit is contained in:
parent
25e1dc5065
commit
e3673c6b18
1 changed files with 15 additions and 11 deletions
|
|
@ -44,17 +44,21 @@ func watchsubdir(watcher *fsnotify.Watcher, pathname string) error {
|
|||
}
|
||||
|
||||
func reloadSettings(config settings.FICSettings) {
|
||||
fic.PartialValidation = config.PartialValidation
|
||||
fic.UnlockedChallenges = !config.EnableExerciceDepend
|
||||
if fic.PartialValidation != config.PartialValidation || fic.UnlockedChallenges != !config.EnableExerciceDepend || fic.FirstBlood != config.FirstBlood || fic.SubmissionCostBase != config.SubmissionCostBase {
|
||||
fic.PartialValidation = config.PartialValidation
|
||||
fic.UnlockedChallenges = !config.EnableExerciceDepend
|
||||
|
||||
fic.FirstBlood = config.FirstBlood
|
||||
fic.SubmissionCostBase = config.SubmissionCostBase
|
||||
fic.FirstBlood = config.FirstBlood
|
||||
fic.SubmissionCostBase = config.SubmissionCostBase
|
||||
|
||||
log.Println("Generating files...")
|
||||
go func() {
|
||||
genAll()
|
||||
log.Println("Full generation done")
|
||||
}()
|
||||
log.Println("Generating files...")
|
||||
go func() {
|
||||
genAll()
|
||||
log.Println("Full generation done")
|
||||
}()
|
||||
} else {
|
||||
log.Println("No change found. Skipping regeneration.")
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
|
|
|||
Reference in a new issue