1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-25 06:50:55 +01:00

Make the hard limit on the number of files showing in Herald emails a constant.

See: <https://github.com/facebook/phabricator/pull/587>

Reviewed by: epriestley
This commit is contained in:
austinkelleher 2014-05-01 10:21:57 -04:00 committed by epriestley
parent c9dc554cb9
commit eec0576793

View file

@ -3,6 +3,8 @@
final class PhabricatorRepositoryCommitHeraldWorker
extends PhabricatorRepositoryCommitParserWorker {
const MAX_FILES_SHOWN_IN_EMAIL = 1000;
public function getRequiredLeaseTime() {
// Herald rules may take a long time to process.
return phutil_units('4 hours in seconds');
@ -138,13 +140,13 @@ final class PhabricatorRepositoryCommitHeraldWorker
? PhabricatorEnv::getProductionURI('/D'.$revision->getID())
: 'No revision.';
$limit = 1000;
$limit = self::MAX_FILES_SHOWN_IN_EMAIL;
$files = $adapter->loadAffectedPaths();
sort($files);
if (count($files) > $limit) {
array_splice($files, $limit);
$files[] = '(This commit affected more than 1000 files. '.
'Only 1000 are shown here and additional ones are truncated.)';
$files[] = '(This commit affected more than '.$limit.' files. '.
'Only '.$limit.' are shown here and additional ones are truncated.)';
}
$files = implode("\n", $files);