refactor(mtproto): sync redesign RPC replay ownership
This commit is contained in:
parent
7e0f9d1e62
commit
ac0566f779
28 changed files with 1304 additions and 343 deletions
20
internal/mtprotoedge/rpc_capacity_error.go
Normal file
20
internal/mtprotoedge/rpc_capacity_error.go
Normal 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,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue