Tracking times of saving pages
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
02be21244d
commit
32328a5a9b
11
file.go
11
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"`
|
||||
|
|
Loading…
Reference in New Issue
Block a user