mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-18 14:47:03 +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:
@@ -37,3 +37,17 @@ func RemoveIfOk(t *testing.T, dir string) {
|
||||
os.RemoveAll(dir)
|
||||
}
|
||||
}
|
||||
|
||||
func Rewrite(t *testing.T, path, contents string) error {
|
||||
// Safeguard, to make sure we only mess with test files.
|
||||
if !strings.Contains(path, "testlib_") {
|
||||
panic("invalid/dangerous path")
|
||||
}
|
||||
|
||||
err := ioutil.WriteFile(path, []byte(contents), 0600)
|
||||
if err != nil {
|
||||
t.Errorf("failed to rewrite file: %v", err)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user