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) 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() { go func() {
for { for {
select { select {
case <-ticker.C: case <-ticker.C:
next := time.Now().Add(interval).Truncate(time.Second)
if Verbose { if Verbose {
fmt.Printf("%s | INDEX: Started scheduled index rebuild\n", time.Now().Format(logDate)) fmt.Printf("%s | INDEX: Started scheduled index rebuild\n", time.Now().Format(logDate))
} }
rebuildIndex(paths, index, formats, errorChannel) 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: case <-quit:
ticker.Stop() ticker.Stop()

View File

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

View File

@ -317,7 +317,6 @@ func serveMedia(paths []string, index *fileIndex, filename *regexp.Regexp, forma
// nonce := format.CSP(w) // nonce := format.CSP(w)
nonce := "" nonce := ""
mediaType := format.MediaType(filepath.Ext(path)) mediaType := format.MediaType(filepath.Ext(path))
fileUri := Prefix + generateFileUri(path) fileUri := Prefix + generateFileUri(path)