Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93849207
PhabricatorClientConnectionLimit.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Dec 2, 00:10
Size
936 B
Mime Type
text/x-php
Expires
Wed, Dec 4, 00:10 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22714074
Attached To
rPH Phabricator
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
"
;
}
}
Event Timeline
Log In to Comment