File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1092,6 +1092,8 @@ fn get_setup() -> Setup {
10921092 tmp_dir
10931093 } ) ;
10941094
1095+ let enable_oauth = opt_present ( ENABLE_OAUTH ) ;
1096+
10951097 let cache = {
10961098 let volume_dir = opt_str ( SYSTEM_CACHE )
10971099 . or_else ( || opt_str ( CACHE ) )
@@ -1139,16 +1141,20 @@ fn get_setup() -> Setup {
11391141 ) ;
11401142 }
11411143
1142- match Cache :: new ( cred_dir, volume_dir, audio_dir, limit) {
1144+ let cache = match Cache :: new ( cred_dir. clone ( ) , volume_dir, audio_dir, limit) {
11431145 Ok ( cache) => Some ( cache) ,
11441146 Err ( e) => {
11451147 warn ! ( "Cannot create cache: {}" , e) ;
11461148 None
11471149 }
1150+ } ;
1151+
1152+ if enable_oauth && ( cache. is_none ( ) || cred_dir. is_none ( ) ) {
1153+ warn ! ( "Credential caching is unavailable, but advisable when using OAuth login." ) ;
11481154 }
1149- } ;
11501155
1151- let enable_oauth = opt_present ( ENABLE_OAUTH ) ;
1156+ cache
1157+ } ;
11521158
11531159 let credentials = {
11541160 let cached_creds = cache. as_ref ( ) . and_then ( Cache :: credentials) ;
You can’t perform that action at this time.
0 commit comments