Append newline to index rebuild HTTP response; remove unneeded error handling for index rebuild handler registration
This commit is contained in:
parent
e9a3ae5e58
commit
fef51438c0
|
@ -433,12 +433,6 @@ Poll:
|
|||
}
|
||||
}
|
||||
|
||||
if filesMatched < 1 {
|
||||
fmt.Println("No files matched")
|
||||
|
||||
return []string{}, nil
|
||||
}
|
||||
|
||||
if Verbose {
|
||||
fmt.Printf("%s | INDEX: Selected %d/%d files across %d/%d directories in %s\n",
|
||||
time.Now().Format(logDate),
|
||||
|
|
|
@ -173,16 +173,10 @@ func serveIndexRebuild(args []string, index *fileIndex, formats types.Types, err
|
|||
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
|
||||
w.Write([]byte("Ok"))
|
||||
w.Write([]byte("Ok\n"))
|
||||
}
|
||||
}
|
||||
|
||||
func registerIndexHandlers(mux *httprouter.Router, args []string, index *fileIndex, formats types.Types, errorChannel chan<- error) error {
|
||||
registerHandler(mux, Prefix+"/index/rebuild", serveIndexRebuild(args, index, formats, errorChannel))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func importIndex(args []string, index *fileIndex, formats types.Types) error {
|
||||
if IndexFile != "" {
|
||||
err := index.Import(IndexFile)
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
ReleaseVersion string = "3.3.1"
|
||||
ReleaseVersion string = "3.3.2"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -544,10 +544,7 @@ func ServePage(args []string) error {
|
|||
registerHandler(mux, Prefix+"/version", serveVersion())
|
||||
|
||||
if Index {
|
||||
err = registerIndexHandlers(mux, args, index, formats, errorChannel)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
registerHandler(mux, Prefix+"/index/rebuild", serveIndexRebuild(args, index, formats, errorChannel))
|
||||
|
||||
err = importIndex(paths, index, formats)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue