SShortSingh.
Back to feed

NestJS open-source package nestjs-quota tackles API quota management atomically

0
·50 views

An open-source NestJS package called nestjs-quota has been released to address multi-tenant API quota enforcement beyond standard rate limiting. The package checks and consumes multiple quota buckets simultaneously in a single atomic operation, preventing race conditions and partial charges that plague conventional implementations. It uses a Redis Lua script to ensure all relevant counters are incremented together or not at all, eliminating double-charging on retried requests. The library supports plan-based dynamic limits, idempotent retries, and a reserve-commit-release model for operations with unknown upfront costs. It ships with NestJS decorators, a guard, and an interceptor, while keeping its core free of runtime dependencies.

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 ·

Borsa Veri Analizi İçin Serdar'ın Seçtiği 8 Kritik Python Kütüphanesi

Borsa verisiyle çalışırken dağınık kaynaklardan veri toplamanın zorluğu, bir yazarın kendi araç setini oluşturmasına yol açmış. Yazar, yfinance, requests ve pandas gibi kütüphaneleri farklı sorunları çözmek için kullandığını anlatıyor. Makalede her paketin kullanım amacı ve sürüm bilgisi ile birlikte, veri kaynağı değişiklikleri, bellek yönetimi ve istek limitleri gibi tipik tuzaklara dikkat çekiliyor. Yazar, iş akışını hızlandırmak için bu araçların önemini vurguluyor. Metin, teknik analiz göstergeleri hesaplayan ta kütüphanesi gibi diğer araçları da kapsıyor.

0
ProgrammingDEV Community ·

Connected components beat projection for estimating text height before OCR

A pre-OCR check that decides whether to upscale a screenshot needs an estimate of text height in pixels, and two simple OpenCV methods were compared. On clean Chinese text both stayed within about 2 px of the true height up to 30 px, but above that projection ran slightly high, while on English projection measured the full line, around 1.37 times the cap height. On a bordered table screenshot projection returned 559 px against 23 px for connected components. Accuracy of two OCR recognizers falls sharply below roughly 12 px, so an estimator a few pixels off near that threshold can misclassify an image. These results come from deliberately clean, single-font samples on one Mac and do not cover compression, noise, or complex layouts.

0
ProgrammingDEV Community ·

Claude से osFoundry knowledge base पर आधारित जवाब और citation कैसे पाएं

यह गाइड बताती है कि Claude, चाहे claude.ai connector के ज़रिए या Claude Code में, किसी osFoundry knowledge base से सवालों के जवाब कैसे दे सकता है। हर दावे के साथ उस article की ID और उसके आखिरी update का समय दिया जाता है, जिससे जवाब की जांच संभव होती है। Claude sequence-based events से बदलावों को भी ट्रैक कर सकता है और बताता है कि कौन से पुराने जवाब बदले हुए article पर निर्भर हैं। Article में सुधार केवल उसी version पर, और केवल उपयोगकर्ता की अनुमति से, किया जा सकता है। Setup में connection बनाना, server URL जोड़ना, project से knowledge base जोड़ना और article publish करना शामिल है, और draft articles Claude की पहुंच से बाहर रहते हैं।

0
ProgrammingDEV Community ·

Why ChatGPT Couldn't Read a Blog: A Server-Level 403 Block Hidden Behind robots.txt

A blogger tested whether ChatGPT could access their website after noticing it never cited their posts. When asked to open a page, ChatGPT reported a 403 Forbidden error, indicating the site was blocking it. Checking robots.txt revealed no restrictions, so the author used curl with different user agents to test the server directly. Results showed that Google and Bingbot were allowed while OpenAI's crawlers, Claude, and Perplexity, along with some SEO tools, received 403 responses. The author concluded that a server-level rule, rather than robots.txt, was responsible for turning these bots away.