1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

domaininfo: Reload periodically

This patch makes chasquid reload domaininfo periodically, so it notices
any external changes made to it.

It is in line with what we do for aliases and authentication already,
and makes it possible for external removals an additions to the
domaininfo database to be picked up without a restart.
This commit is contained in:
Alberto Bertogli
2018-05-20 12:21:15 +01:00
parent 2064e9e65d
commit a177fec7c3
5 changed files with 83 additions and 25 deletions

View File

@@ -140,11 +140,6 @@ func (s *Server) InitDomainInfo(dir string) *domaininfo.DB {
log.Fatalf("Error opening domain info database: %v", err)
}
err = s.dinfo.Load()
if err != nil {
log.Fatalf("Error loading domain info database: %v", err)
}
return s.dinfo
}
@@ -176,6 +171,11 @@ func (s *Server) periodicallyReload() {
if err != nil {
log.Errorf("Error reloading authenticators: %v", err)
}
err = s.dinfo.Reload()
if err != nil {
log.Errorf("Error reloading domaininfo: %v", err)
}
}
}