Display time of next scheduled index rebuild
This commit is contained in:
parent
3fd2bf6bb3
commit
fc425425b5
11
cmd/index.go
11
cmd/index.go
|
@ -316,15 +316,26 @@ func registerIndexInterval(paths []string, index *fileIndex, formats types.Types
|
|||
|
||||
ticker := time.NewTicker(interval)
|
||||
|
||||
if Verbose {
|
||||
next := time.Now().Add(interval).Truncate(time.Second)
|
||||
fmt.Printf("%s | INDEX: Next scheduled rebuild will run at %s\n", time.Now().Format(logDate), next.Format(logDate))
|
||||
}
|
||||
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
next := time.Now().Add(interval).Truncate(time.Second)
|
||||
|
||||
if Verbose {
|
||||
fmt.Printf("%s | INDEX: Started scheduled index rebuild\n", time.Now().Format(logDate))
|
||||
}
|
||||
|
||||
rebuildIndex(paths, index, formats, errorChannel)
|
||||
|
||||
if Verbose {
|
||||
fmt.Printf("%s | INDEX: Next scheduled rebuild will run at %s\n", time.Now().Format(logDate), next.Format(logDate))
|
||||
}
|
||||
case <-quit:
|
||||
ticker.Stop()
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
|
||||
const (
|
||||
AllowedCharacters string = `^[A-z0-9.\-_]+$`
|
||||
ReleaseVersion string = "8.7.4"
|
||||
ReleaseVersion string = "8.8.0"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -317,7 +317,6 @@ func serveMedia(paths []string, index *fileIndex, filename *regexp.Regexp, forma
|
|||
// nonce := format.CSP(w)
|
||||
nonce := ""
|
||||
|
||||
|
||||
mediaType := format.MediaType(filepath.Ext(path))
|
||||
|
||||
fileUri := Prefix + generateFileUri(path)
|
||||
|
|
Loading…
Reference in New Issue