only save to cache if success
Build and Push Docker Images / build-and-push (push) Successful in 2m10s
Build and Push Docker Images / build-and-push (push) Successful in 2m10s
This commit is contained in:
@@ -31,8 +31,9 @@ async def visit_url(url: str, skipCache: bool = False, x_api_key: Optional[str]
|
||||
# Call the service function
|
||||
result = await visit_url_service(decoded_url)
|
||||
|
||||
# Save to cache (even if we skipped reading from it)
|
||||
save_to_cache(decoded_url, "visit", result)
|
||||
if(result["status"] == "success"):
|
||||
# Save to cache (even if we skipped reading from it)
|
||||
save_to_cache(decoded_url, "visit", result)
|
||||
|
||||
return result
|
||||
except Exception as e:
|
||||
@@ -60,7 +61,8 @@ async def extract_seo(url: str, skipCache: bool = False, x_api_key: Optional[str
|
||||
result = await extract_seo_service(decoded_url)
|
||||
|
||||
# Save to cache
|
||||
save_to_cache(decoded_url, "seo", result)
|
||||
if(result["status"] == "success"):
|
||||
save_to_cache(decoded_url, "seo", result)
|
||||
|
||||
return result
|
||||
except Exception as e:
|
||||
@@ -87,7 +89,8 @@ async def extract_meta_tags(url: str, skipCache: bool = False, x_api_key: Option
|
||||
result = await extract_meta_tags_service(decoded_url)
|
||||
|
||||
# Save to cache
|
||||
save_to_cache(decoded_url, "meta", result)
|
||||
if(result["status"] == "success"):
|
||||
save_to_cache(decoded_url, "meta", result)
|
||||
|
||||
return result
|
||||
except Exception as e:
|
||||
@@ -114,7 +117,8 @@ async def detect_pagination(url: str, skipCache: bool = False, x_api_key: Option
|
||||
result = await detect_pagination_service(decoded_url)
|
||||
|
||||
# Save to cache
|
||||
save_to_cache(decoded_url, "pagination", result)
|
||||
if(result["status"] == "success"):
|
||||
save_to_cache(decoded_url, "pagination", result)
|
||||
|
||||
return result
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user