⚖ Compare news

Put up to three stories side by side. Pick IDs from any article URL: /compare?id=123&id=456

Один слот, два покупателя: как избежать двойной брони в Telegram-боте

habrahabr.ru ·Russian Federation · politics
Words
35
Chars
251
AI summary
Yes
Full story

One consultation slot remained, and two users pressed 'Pay' at the same time. The author shows how to reserve the slot before payment using Telegram Stars. The article also covers checking locks in two PostgreSQL sessions and dealing with a payment that comes after the reservation expires.

На консультацию осталось одно место, а кнопку «Оплатить» нажали двое. Покажу, как зарезервировать слот до оплаты в Telegram Stars, проверить блокировку в двух сессиях PostgreSQL и обработать платёж, который пришёл после истечения резерва. Читать далее

Open article