mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-01 01:18:22 +01:00
Put a limit on the number of files showing in herald emails
Summary: Sometimes a commit can be huge (like a branch cut in FB www which could have more than half a million files touched). It will generate some emails with size more than 30M, and it will take quite a while to just sort the files and to send out. Put a hard limit here to avoid such cases. Probably only matters for FB right now, but still even for a small repo with several thousand files, it is a waste to send them all out. Not sure if there is any cleaner way to do it though. Test Plan: Tried it in FB installtion. Reviewers: lifeihuang, epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D8889
This commit is contained in:
parent
cafd2dd6cb
commit
3a0694543d
1 changed files with 6 additions and 0 deletions
|
@ -138,8 +138,14 @@ final class PhabricatorRepositoryCommitHeraldWorker
|
|||
? PhabricatorEnv::getProductionURI('/D'.$revision->getID())
|
||||
: 'No revision.';
|
||||
|
||||
$limit = 1000;
|
||||
$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 = implode("\n", $files);
|
||||
|
||||
$xscript_id = $xscript->getID();
|
||||
|
|
Loading…
Add table
Reference in a new issue