Merge branch 'periodicRefresh' into 'master'
Add a config to set the info refresh interval See merge request !83
This commit is contained in:
commit
a14bccf75c
@ -7,6 +7,7 @@ listen_port: 3000
|
|||||||
public_dir: build/public
|
public_dir: build/public
|
||||||
# default prefix, will be served by the go http server
|
# default prefix, will be served by the go http server
|
||||||
img_url_prefix: img/
|
img_url_prefix: img/
|
||||||
|
periodic_refresh: 12h
|
||||||
|
|
||||||
movie:
|
movie:
|
||||||
detailers:
|
detailers:
|
||||||
|
@ -18,6 +18,7 @@ type Config struct {
|
|||||||
Port string `yaml:"listen_port"`
|
Port string `yaml:"listen_port"`
|
||||||
PublicDir string `yaml:"public_dir"`
|
PublicDir string `yaml:"public_dir"`
|
||||||
ImgURLPrefix string `yaml:"img_url_prefix"`
|
ImgURLPrefix string `yaml:"img_url_prefix"`
|
||||||
|
PeriodicRefresh string `yaml:"periodic_refresh"`
|
||||||
|
|
||||||
MovieExplorers []polochon.Explorer
|
MovieExplorers []polochon.Explorer
|
||||||
MovieDetailers []polochon.Detailer
|
MovieDetailers []polochon.Detailer
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
@ -73,7 +74,8 @@ func main() {
|
|||||||
c := cron.New()
|
c := cron.New()
|
||||||
|
|
||||||
// Refresh the library every 6h
|
// Refresh the library every 6h
|
||||||
c.AddFunc("@every 6h", func() {
|
env.Log.Debugf("Running refresh cron every %s", cf.PeriodicRefresh)
|
||||||
|
c.AddFunc(fmt.Sprintf("@every %s", cf.PeriodicRefresh), func() {
|
||||||
env.Log.Infof("Running refresh cron!")
|
env.Log.Infof("Running refresh cron!")
|
||||||
extmedias.Refresh(env)
|
extmedias.Refresh(env)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user