🐛 Use relative path when cache token
This commit is contained in:
1 parent
20d6f26a1f
commit
24f5dd9118
3 files changed
+4
-4
No files matched your search
+2
-2
@@ -115,11 +115,11 @@ func WithCacheToken(token string, fsys fs.FS) Option {
|
||||
if err != nil {
|
||||
slog.Warn(readTokenFailed, "path", absToken, "error", err)
|
||||
}
|
||||
s.tokenFile = absToken
|
||||
s.tokenFile = relToken
|
||||
s.CacheToken = string(tokenBytes)
|
||||
return
|
||||
} else if os.IsNotExist(err) && strings.HasSuffix(token, ".json") {
|
||||
s.tokenFile = absToken
|
||||
s.tokenFile = relToken
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ func TestNewY2BService(t *testing.T) {
|
||||
Credential: credential,
|
||||
CacheToken: cacheToken,
|
||||
credFile: "/client_secrets.json",
|
||||
tokenFile: "/youtube.token.json",
|
||||
tokenFile: "youtube.token.json",
|
||||
ctx: context.Background(),
|
||||
},
|
||||
},
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ func init() {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
logLevel := slog.LevelInfo
|
||||
logLevel := slog.LevelWarn
|
||||
if lvl, ok := os.LookupEnv("YUTU_LOG_LEVEL"); ok {
|
||||
switch lvl {
|
||||
case "DEBUG", "debug":
|
||||
|
||||
Reference in new issue
Block a user