SShortSingh.
Back to feed

Seven common Laravel queue mistakes that cause lost or duplicated jobs in production

0
·10 views

A developer guide outlines how Laravel queue problems, such as emails sent twice or reports never arriving, typically stem from a short list of recurring errors. Running jobs synchronously in production means they execute inside the request, hiding failures and slowing pages. Long-running workers keep old code in memory after deploys, so they need restarting, typically via queue:restart and a process supervisor like Supervisor. A worker timeout that exceeds the queue's retry_after setting can cause a second worker to pick up a job still in progress, producing duplicates. The article also recommends using afterCommit or the after_commit setting so jobs dispatched inside database transactions don't run before the data is saved, and configuring retry counts with backoff delays for flaky external APIs.

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 ·

StackAudit: one debug inspector for KMP, Android, iOS and Flutter apps

StackAudit is a free, open-source debugging inspector designed to work the same across Kotlin Multiplatform, Android, iOS and Flutter. Unlike tools that only capture HTTP traffic, it records analytics events, feature flags, key-value storage writes and database activity in a single timeline. Developers can shake a device to view the log and export sessions as HAR, JSONL, CSV or text, with no backend involved. The tool is built to be safe for QA builds, masking secrets like tokens and passwords before storage, encrypting bodies at rest, and chaining events with hashes to detect tampering. It is released under the Apache 2.0 license, with the Flutter integration still in beta.

0
ProgrammingDEV Community ·

KZG polynomial commitments: the verification check, and where real implementations broke

KZG lets a prover commit to a polynomial with a single curve point and later prove its value at a chosen point without revealing the polynomial. The article explains that a single verifier check underlies most Ethereum blob verification and many PLONK proofs. It builds the check step by step, starting from the claim that a polynomial evaluates to a given value at a random point. The author argues that the mathematics is sound and that real vulnerabilities, such as the Frozen Heart bug, arose in the surrounding code. The post also includes a 22-item security checklist and runnable Rust code, published as a GitHub README.

0
ProgrammingDEV Community ·

Node.js OTP Password Reset Design Separates SMS Dispatch From Validation

The article describes building a password reset OTP flow in Node.js, using crypto for code generation and an external SMS API for delivery. It argues that SMS dispatch, code expiration, and successful validation should be recorded as separate events rather than treated as one. Each challenge is bound to a specific account and reset purpose, and the phone number and code are kept out of logs. The author recommends checking expiration against the current time and consuming challenges atomically to prevent concurrent reuse. A TypeScript example demonstrates the local challenge lifecycle, though production use would require persistent storage and conditional updates.

0
ProgrammingDEV Community ·

Phone Calls Drive Leads That Web Analytics Miss; Next.js Source Tracking Fixes It

A plumbing client found that most of his leads came from phone calls placed after visitors clicked a tel: link, which his Google Ads account never recorded because it only tracked form submissions. As a result, the campaigns generating calls were underfunded while form-driven campaigns received more budget. The article explains that UTM parameters and click IDs are often lost as visitors navigate or return later, and that tel: clicks happen off the web entirely. It proposes a Next.js middleware that stores first-touch campaign data in a cookie lasting ninety days, matching Google Ads' maximum conversion window. A client-side phone link component then reads this cookie on click so the call can be attributed to its source.