@@ -57,7 +57,7 @@ def request_with_retry(self,
5757 api_path = url ,
5858 domain = self .domain_list [domain_index ],
5959 )
60- jm_debug ('api' , url )
60+ jm_debug (self . debug_topic_request () , url )
6161 else :
6262 # 图片url
6363 pass
@@ -82,6 +82,10 @@ def request_with_retry(self,
8282 else :
8383 return self .request_with_retry (request , url , domain_index + 1 , 0 , ** kwargs )
8484
85+ # noinspection PyMethodMayBeStatic
86+ def debug_topic_request (self ):
87+ return 'html'
88+
8589 # noinspection PyMethodMayBeStatic, PyUnusedLocal
8690 def before_retry (self , e , kwargs , retry_count , url ):
8791 jm_debug ('req.err' , str (e ))
@@ -124,6 +128,11 @@ def wrap_func_cache(func_name, cache_dict_name):
124128 }:
125129 wrap_func_cache (func , func + '.cache.dict' )
126130
131+ setattr (self , '__enable_cache__' , True )
132+
133+ def is_cache_enabled (self ) -> bool :
134+ return getattr (self , '__enable_cache__' , False )
135+
127136 def get_jmcomic_url (self , postman = None ):
128137 return JmModuleConfig .get_jmcomic_url (postman or self .get_root_postman ())
129138
0 commit comments