Source code Cost

Polling where webhook exists

Part of the Cost controls check · fix arrives as a guide

What it is

The code polls a third-party API on a timer for state changes that the same provider already publishes as a webhook.

Why it matters

Polling pays for every check that finds nothing, and the bill scales with your poll frequency rather than with real events. It also adds latency: you learn about the change on the next tick rather than when it happened.

How to fix it

Subscribe to the provider's webhook and handle the event when it arrives. Keep a low-frequency poll only as a reconciliation backstop for missed deliveries, not as the primary path.

Run them all on your app

Connect your repo and your live services with read-only scopes. The first scan is free, and nothing changes without your approval.