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:
@@ -52,3 +52,27 @@ func TestLeaveDirOnError(t *testing.T) {
|
||||
// Remove the directory for real this time.
|
||||
RemoveIfOk(t, dir)
|
||||
}
|
||||
|
||||
func TestRewriteSafeguard(t *testing.T) {
|
||||
myt := &testing.T{}
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
t.Logf("recovered: %v", r)
|
||||
} else {
|
||||
t.Fatalf("check did not panic as expected")
|
||||
}
|
||||
}()
|
||||
|
||||
Rewrite(myt, "/something", "test")
|
||||
}
|
||||
|
||||
func TestRewrite(t *testing.T) {
|
||||
dir := MustTempDir(t)
|
||||
defer RemoveIfOk(t, dir)
|
||||
|
||||
myt := &testing.T{}
|
||||
Rewrite(myt, dir+"/file", "hola")
|
||||
if myt.Failed() {
|
||||
t.Errorf("basic rewrite failed")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user