refactor(mtproto): sync redesign RPC replay ownership

This commit is contained in:
iamxvbaba 2026-08-02 01:51:03 +08:00
parent 7e0f9d1e62
commit ac0566f779
28 changed files with 1304 additions and 343 deletions

View file

@ -0,0 +1,20 @@
package mtprotoedge
import "github.com/iamxvbaba/td/mt"
const (
rpcWorkerBusyErrorCode = 500
rpcWorkerBusyErrorMessage = "WORKER_BUSY_TOO_LONG_RETRY"
)
// rpcWorkerBusyError reports transient server admission pressure. A local
// worker/queue/ledger ceiling is not Telegram flood control: returning a 420
// FLOOD_WAIT would falsely blame the account and makes clients surface or cache
// a rate-limit state. Official clients classify 5xx as transient; TDLib and
// DrKlo additionally recognize WORKER_BUSY_TOO_LONG_RETRY and retry with delay.
func rpcWorkerBusyError() *mt.RPCError {
return &mt.RPCError{
ErrorCode: rpcWorkerBusyErrorCode,
ErrorMessage: rpcWorkerBusyErrorMessage,
}
}