dpgaspar commented on code in PR #23853:
URL: https://github.com/apache/superset/pull/23853#discussion_r1229733997


##########
superset/tasks/cache.py:
##########
@@ -207,35 +206,46 @@ def get_urls(self) -> list[str]:
         chart_ids = [tagged_object.object_id for tagged_object in 
tagged_objects]
         tagged_charts = session.query(Slice).filter(Slice.id.in_(chart_ids))
         for chart in tagged_charts:
-            urls.append(get_url(chart))
+            payloads.append(get_payload(chart))
 
-        return urls
+        return payloads
 
 
 strategies = [DummyStrategy, TopNDashboardsStrategy, DashboardTagsStrategy]
 
 
 @celery_app.task(name="fetch_url")
-def fetch_url(url: str, headers: dict[str, str]) -> dict[str, str]:
+def fetch_url(data: str, headers: dict[str, str]) -> dict[str, str]:
     """
     Celery job to fetch url
     """
     result = {}
     try:
-        logger.info("Fetching %s", url)
-        req = request.Request(url, headers=headers)
+        baseurl = "{WEBDRIVER_BASEURL}".format(**app.config)
+        url = f"{baseurl}api/v1/chart/warm_up_cache"
+        logger.info("Fetching %s with payload %s", url, data)

Review Comment:
   nit: checked that data contains the `get_payload` that only contains 
`chart_id` and `dashboard_id` so it's probably safe to log, but I would just 
remove it from the logs, it can also generate a huge log entry



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to