codeant-ai-for-open-source[bot] commented on PR #38576:
URL: https://github.com/apache/superset/pull/38576#issuecomment-4054574452
## **Sequence Diagram**
This PR prevents duplicate dashboard thumbnail generation at two points: the
API now marks work as computing before enqueueing, and the Celery task now
skips if a fresh computing task already exists. Together, this avoids
concurrent Selenium sessions for the same dashboard.
```mermaid
sequenceDiagram
participant Client
participant DashboardAPI
participant Cache
participant CeleryTask
participant ScreenshotService
Client->>DashboardAPI: Request dashboard thumbnail
DashboardAPI->>Cache: Mark cache status as computing
DashboardAPI->>CeleryTask: Enqueue thumbnail task
Client->>DashboardAPI: Concurrent thumbnail request
DashboardAPI->>Cache: Check cache status
DashboardAPI-->>Client: Skip enqueue because already computing
CeleryTask->>Cache: Check existing status for cache key
alt Computing and not stale
CeleryTask-->>CeleryTask: Skip duplicate task
else Not computing or stale
CeleryTask->>ScreenshotService: Compute and cache thumbnail
end
```
---
*Generated by [CodeAnt AI](https://codeant.ai)*
--
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]