SShortSingh.
Back to feed

Munchable's maintenance switch: one boolean takes down database-backed routes only

0
·1 views

Munchable is preparing a database migration and wants to avoid running it under live traffic. Before that, the developer built a maintenance switch, a single exported boolean constant that is flipped by hand and committed, rather than stored as an environment variable. The switch decides how each URL is handled: API routes, app routes behind login, and public pages, with public content such as recipes and guides staying online because it is prerendered at build time. The proxy checks the switch first and returns a maintenance response before making any call to the Supabase session service. The author also notes that prefix matching must respect whole path segments, so routes like /administration are not wrongly caught.

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 ·

Why Stripe payouts often differ from bank deposits and ledger records

A synthetic September example shows a €3,496.99 gap between the ledger's net Stripe activity and the Stripe deposits in the bank. The gap is not one error but several differences with opposite signs. The largest share, €3,347.78, is a payout that reached the bank on 1 October after the month-end cutoff. The remaining differences include duplicate sales, unbooked disputes and fees, and amount mismatches. The approach breaks the reconciliation into operation, payout, and bank levels, with a bridge that must add up to the cent.

0
ProgrammingDEV Community ·

Building a Dependency-Free Job Queue in Go Using Channels and Goroutines

The article argues that many applications can handle background job processing without Redis or other external queues, since Go's concurrency primitives are sufficient for in-process work. It notes that external queues remain the better choice when persistence across restarts, distributed workers, or guaranteed delivery are required. The author presents a channel-based design where jobs are closures passed through a buffered channel to a pool of worker goroutines. The Enqueue method returns false when the queue is full, leaving the caller to decide how to respond, and workers handle context cancellation separately from channel closure. A sample HTTP server demonstrates the queue sending emails in the background with graceful shutdown.

0
ProgrammingDEV Community ·

How to Work with Multiple Git Remotes in One Repository

A git remote is the location where a repository is stored, and hosting platforms such as GitHub are commonly used for this purpose. The guide explains how to create a new, empty repository and link an existing local repository to it using the git remote add command with a chosen name and URL. Once connected, changes can be pushed to the chosen remote. A default remote can be set through the push.default configuration, or a specific remote and branch can be named explicitly in each push command.

0
ProgrammingDEV Community ·

Artificial Analysis Scores DeepSeek V4.1 Flash 1017 Higher, at Lower Per-Task Cost

Artificial Analysis rates the reasoning version of DeepSeek's V4.1 Flash 1017 at 45 on its Intelligence Index, up from 39 for the previous V4.1 Flash. The model's per-token list price is unchanged, yet the cost to run the index fell from $0.49 to $0.26 per task, with output token usage dropping from 250 million to 210 million. The analysis notes that the answers remain relatively long, and that the reported cost assumes peak-hour pricing and maximum reasoning effort, which many users may not match. The findings were posted to Hacker News on October 19, after DeepSeek had released the update on October 17 with a promise of shorter outputs.