mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-01 00:43:23 +08:00
Markdown: Modify development mode to generate links on page requests.
This commit is contained in:
@ -199,7 +199,7 @@ func getTrue() bool {
|
||||
}
|
||||
}
|
||||
|
||||
// attempt to trigger race condition
|
||||
// attempt to trigger race conditions
|
||||
var w sync.WaitGroup
|
||||
f := func() {
|
||||
req, err := http.NewRequest("GET", "/log/test.md", nil)
|
||||
@ -217,6 +217,16 @@ func getTrue() bool {
|
||||
}
|
||||
w.Wait()
|
||||
|
||||
f = func() {
|
||||
GenerateLinks(md, &md.Configs[0])
|
||||
w.Done()
|
||||
}
|
||||
for i := 0; i < 5; i++ {
|
||||
w.Add(1)
|
||||
go f()
|
||||
}
|
||||
w.Wait()
|
||||
|
||||
if err = os.RemoveAll(DefaultStaticDir); err != nil {
|
||||
t.Errorf("Error while removing the generated static files: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user