Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892259
PhabricatorClientConnectionLimit.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
936 B
Referenced Files
None
Subscribers
None
PhabricatorClientConnectionLimit.php
View Options
<?php
final
class
PhabricatorClientConnectionLimit
extends
PhabricatorClientLimit
{
protected
function
getBucketDuration
(
)
{
return
60
;
}
protected
function
getBucketCount
(
)
{
return
15
;
}
protected
function
shouldRejectConnection
(
$score
)
{
// Reject connections if the cumulative score across all buckets exceeds
// the limit.
return
(
$score
>
$this
->
getLimit
(
)
)
;
}
protected
function
getConnectScore
(
)
{
return
1
;
}
protected
function
getPenaltyScore
(
)
{
return
0
;
}
protected
function
getDisconnectScore
(
array
$request_state
)
{
return
-
1
;
}
protected
function
getRateLimitReason
(
$score
)
{
$client_key
=
$this
->
getClientKey
(
)
;
// NOTE: This happens before we load libraries, so we can not use pht()
// here.
return
"TOO MANY CONCURRENT CONNECTIONS\n"
.
"You (\"{$client_key}\") have too many concurrent "
.
"connections.\n"
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 16:30 (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126499
Default Alt Text
PhabricatorClientConnectionLimit.php (936 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment