SShortSingh.
Back to feed

Node.js backpressure for daily report emails: cron scheduling, queued delivery, and rate-limit recovery

0
·11 views

The article recommends running the daily report via cron, publishing one idempotent job per email delivery, and using a bounded worker pool to respect the email provider's rate limit. It argues the real goal is controlled recovery after 429 responses, so the backlog stays trackable, duplicate-safe, and drains without causing a traffic spike the next day. The scheduled handler should only generate recipients and enqueue jobs, since cron runs are capped at 900 seconds and cannot cover a long drain. Each delivery gets a stable ID with a unique constraint, the queue is acknowledged only after durable acceptance, and a token bucket paces requests before the provider call. Push delivery is presented as a transport option that requires a public HTTPS endpoint, not as a rate-limiting mechanism.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Event-Driven Audit Log Ingestion Versus Direct Database Writes at Scale

The article argues that synchronous writes of audit logs to a relational database become a throughput bottleneck in high-volume SaaS platforms, where microservices can emit tens of thousands of privileged events per second. Such bottlenecks can cause back-pressure, raise API latency, and jeopardize regulatory audit visibility windows. The proposed alternative decouples producers from storage using message brokers such as Kafka, paired with idempotent writes, schema registries, and tiered hot and cold storage. The piece also covers operational concerns like tamper-evidence hashing, tracing, lag alerting, and batch and consumer tuning. It compares this pipeline against direct RDBMS writes, outlining trade-offs in complexity, cost, and consistency.

0
ProgrammingDEV Community ·

Phorge and Phabricator installations need migration-aware exposure reviews

Phorge is a maintained fork of Phabricator, and many live installations still show the older product name in their page titles, which can distort searches. A title search returned 244 matches for Phabricator and 34 for Phorge on 2026-11-11, but these counts are treated as overlapping, unverified candidate sets rather than a census. The article stresses that API bearer tokens carry the permissions of their owning account, so reviewers should map which accounts and applications each token can reach. It also recommends reviewing registration policies and authentication providers, since changes there are high-impact and open sign-up could let outsiders create accounts. Each candidate host should be confirmed as Phorge or legacy Phabricator before any conclusions are drawn.

0
ProgrammingDEV Community ·

MCP Bastion Flags a Silent Change to an AI Tool Description

The author edited a single sentence in the description of an MCP tool called get_uptime, which changed the tool's promise from reporting uptime to also reporting deployment region. Scanned alone, the altered definition raised no issues, but compared against the previously approved copy it triggered a HIGH-severity finding and a failing exit code. The case illustrates how an ordinary wording change can alter what an AI agent is asked to do without a fresh review. The author presented this as a demonstration of MCP Bastion, an open-source scanner for Model Context Protocol servers and agent tools. The scanner was tested at version 0.4.0 using saved tool definitions, and the experiment can be reproduced without a model, API key, or running server.

0
ProgrammingDEV Community ·

AI agent sells $0.15 AI-readiness audits and publishes all revenue on a public ledger

Script Master Labs has launched The Apprentice, a 30-day autonomous experiment that sells AI-readiness audits for one URL at $0.15 USDC per call over the x402 protocol on Base. Each call returns a deterministic 28-check audit, a markdown extraction of the page, and a short research brief, and failed runs are not charged. The experiment started with a $100 USDC seed under strict per-payment and daily spending limits, and only outside-party revenue counts toward its earnings. As of day two, the public ledger showed $0 in outside revenue and $0.02 spent on build-bounty claims. The audit was newly added to the OMNIGATE gateway and the HIVE402 catalog to improve discoverability.