Path: blob/master/support/startup/PhabricatorClientConnectionLimit.php
12240 views
<?php12final class PhabricatorClientConnectionLimit3extends PhabricatorClientLimit {45protected function getBucketDuration() {6return 60;7}89protected function getBucketCount() {10return 15;11}1213protected function shouldRejectConnection($score) {14// Reject connections if the cumulative score across all buckets exceeds15// the limit.16return ($score > $this->getLimit());17}1819protected function getConnectScore() {20return 1;21}2223protected function getPenaltyScore() {24return 0;25}2627protected function getDisconnectScore(array $request_state) {28return -1;29}3031protected function getRateLimitReason($score) {32$client_key = $this->getClientKey();3334// NOTE: This happens before we load libraries, so we can not use pht()35// here.3637return38"TOO MANY CONCURRENT CONNECTIONS\n".39"You (\"{$client_key}\") have too many concurrent ".40"connections.\n";41}4243}444546