Display time of next scheduled index rebuild

This commit is contained in:
Seednode 2024-02-15 18:01:54 -06:00
parent 3fd2bf6bb3
commit fc425425b5
3 changed files with 12 additions and 2 deletions

View File

@ -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()

View File

@ -17,7 +17,7 @@ import (
const (
AllowedCharacters string = `^[A-z0-9.\-_]+$`
ReleaseVersion string = "8.7.4"
ReleaseVersion string = "8.8.0"
)
var (

View File

@ -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)