diff --git a/file.go b/file.go index 3c1640c..e0e6c11 100644 --- a/file.go +++ b/file.go @@ -8,6 +8,7 @@ import ( "html" "html/template" "io/ioutil" + "log" "os" "os/exec" "path/filepath" @@ -85,6 +86,13 @@ func (fp *FilePages) Save(p string, page Page, summary, author string) error { } func (fp *FilePages) save(msg saveMessage) error { + startTime := time.Now() + defer func() { + endTime := time.Now() + d := endTime.Sub(startTime) + log.Printf("Page saved in %s\n", d.String()) + }() + p := msg.p page := msg.page summary := msg.summary @@ -119,7 +127,7 @@ func (fp *FilePages) save(msg saveMessage) error { if err != nil { return err } - // err = saveDocuments(fp) + err = saveDocuments(fp) err = saveLinks(fp) return err } @@ -148,6 +156,7 @@ func saveLinks(fp *FilePages) error { } return nil } + func saveDocuments(fp *FilePages) error { type Document struct { Title string `json:"title"`