PERF: Frontend polls 4 endpoints every 1 second regardless of deployment state #43

Closed
opened 2026-02-16 06:56:36 +01:00 by clawbot · 1 comment
Collaborator

Severity: MEDIUM

File: static/js/app.js — appDetail component, init()

Description

setInterval(() => this.fetchAll(), 1000);

fetchAll() calls 4 endpoints every second:

  • /apps/{id}/status
  • /apps/{id}/container-logs
  • /apps/{id}/deployments/{id}/logs
  • /apps/{id}/recent-deployments

This happens even when nothing is deploying and the app is in a stable state. For a single-user app this is wasteful but tolerable; for multiple browser tabs it multiplies.

Suggested Fix

  1. Poll every 1s only during active deployments (building/deploying status)
  2. When idle (running/stopped/error), poll every 10-30 seconds
  3. Only poll container-logs and build-logs when the respective pane is visible
const interval = Alpine.store("utils").isDeploying(this.appStatus) ? 1000 : 15000;
## Severity: MEDIUM ## File: `static/js/app.js` — appDetail component, init() ## Description ```js setInterval(() => this.fetchAll(), 1000); ``` `fetchAll()` calls 4 endpoints every second: - `/apps/{id}/status` - `/apps/{id}/container-logs` - `/apps/{id}/deployments/{id}/logs` - `/apps/{id}/recent-deployments` This happens **even when nothing is deploying** and the app is in a stable state. For a single-user app this is wasteful but tolerable; for multiple browser tabs it multiplies. ## Suggested Fix 1. Poll every 1s only during active deployments (`building`/`deploying` status) 2. When idle (running/stopped/error), poll every 10-30 seconds 3. Only poll container-logs and build-logs when the respective pane is visible ```js const interval = Alpine.store("utils").isDeploying(this.appStatus) ? 1000 : 15000; ```
Owner

implement all fixes on a PR. idle interval check should be 10s.

implement all fixes on a PR. idle interval check should be 10s.
sneak closed this issue 2026-02-16 07:03:47 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/upaas#43
No description provided.