Explorar o código

add flow except

ming %!s(int64=3) %!d(string=hai) anos
pai
achega
245e81dcb1
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      similar_web/main.py

+ 2 - 2
similar_web/main.py

@@ -139,9 +139,9 @@ async def get_domain_by_keyword(req:kw_req):
             jsdict['totalVisits'] = js2['engagement']['totalVisits']
             jsdict['EstimatedMonthlyVisits']=js2['monthlyVisitsEstimate']
         except:
-            jsdict['totalVisits'] ='no data'
+            jsdict['totalVisits'] = -1
             jsdict['EstimatedMonthlyVisits'] = 'no data'
-            
+
         log_table = db['storage_similar_web']
         log_table.insert({'SiteName':raw_domain,'Description':jsdict['Description'],'GlobalRank':jsdict['GlobalRank']
         ,'Title':jsdict['Title'],'Category':jsdict['Category'],'CountryRank':jsdict['CountryRank'],'EstimatedMonthlyVisits':jsdict['EstimatedMonthlyVisits']