From eec0576793b1fd1ccf9e2b6317d8efe27423c87f Mon Sep 17 00:00:00 2001 From: austinkelleher Date: Thu, 1 May 2014 10:21:57 -0400 Subject: [PATCH] Make the hard limit on the number of files showing in Herald emails a constant. See: Reviewed by: epriestley --- .../worker/PhabricatorRepositoryCommitHeraldWorker.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php b/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php index f65f2a1750..70b5373754 100644 --- a/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php +++ b/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php @@ -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);