login-validator: Fix not reloading issue
This commit is contained in:
parent
0bceec2023
commit
afed114190
@ -100,7 +100,7 @@ func main() {
|
|||||||
|
|
||||||
log.Println("Registering handlers...")
|
log.Println("Registering handlers...")
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
mux.Handle("/login", lc)
|
mux.Handle("/login", &lc)
|
||||||
mux.HandleFunc("/logout", logout)
|
mux.HandleFunc("/logout", logout)
|
||||||
mux.HandleFunc("/passwd", passwd)
|
mux.HandleFunc("/passwd", passwd)
|
||||||
http.HandleFunc("/", mux.ServeHTTP)
|
http.HandleFunc("/", mux.ServeHTTP)
|
||||||
@ -119,6 +119,8 @@ mloop:
|
|||||||
log.Println("Reloading students files...")
|
log.Println("Reloading students files...")
|
||||||
if lc.students, err = readStudentsList(studentsFile); err != nil {
|
if lc.students, err = readStudentsList(studentsFile); err != nil {
|
||||||
log.Println("Error during students.csv reload:", err)
|
log.Println("Error during students.csv reload:", err)
|
||||||
|
} else {
|
||||||
|
log.Printf("Students reloaded: %d students allowed to login", len(lc.students))
|
||||||
}
|
}
|
||||||
case syscall.SIGTERM, syscall.SIGINT:
|
case syscall.SIGTERM, syscall.SIGINT:
|
||||||
break mloop
|
break mloop
|
||||||
|
Reference in New Issue
Block a user