mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-11-29 05:49:56 +00:00
TronGrid's free plan allows 10,000 requests a day. Checking every user's TRC20 address on every five-minute run needs ~29,000 a day at 101 users, so the key ran out at 03:00 UTC and every later run was refused. get-deposit-info now records when a user opened the deposit screen. check-deposits checks users seen in the last 24 hours on every run and everyone in one run every six hours (00, 06, 12, 18 UTC): about 3,300 requests a day at 10 active users. A deposit made without opening the screen within the past day waits for the next full scan. The user-list query now reports its error instead of ending the TRC20 check as if there were no users.
5 lines
305 B
SQL
5 lines
305 B
SQL
-- When the user last opened the deposit screen. check-deposits checks the
|
|
-- TRC20 addresses of users seen in the last 24 hours on every run and all
|
|
-- users only every six hours, to stay inside TronGrid's free daily quota.
|
|
ALTER TABLE tg_users ADD COLUMN IF NOT EXISTS deposit_info_seen_at timestamptz;
|