add cache_timeout option

controls how old the Jellyfin user cache can be before refetching. defaults to 30 minutes.
This commit is contained in:
Harvey Tindall
2020-11-02 23:26:46 +00:00
parent d4a92adc65
commit 8e45ecb214
5 changed files with 15 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ type testReq struct {
func (app *appContext) TestJF(gc *gin.Context) {
var req testReq
gc.BindJSON(&req)
tempjf, _ := jfapi.NewJellyfin(req.Host, "jfa-go-setup", app.version, "auth", "auth", common.NewTimeoutHandler("authJF", req.Host, true))
tempjf, _ := jfapi.NewJellyfin(req.Host, "jfa-go-setup", app.version, "auth", "auth", common.NewTimeoutHandler("authJF", req.Host, true), 30)
_, status, err := tempjf.Authenticate(req.Username, req.Password)
if !(status == 200 || status == 204) || err != nil {
app.info.Printf("Auth failed with code %d (%s)", status, err)