Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14475150
D8040.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8040.diff
View Options
Index: src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php
===================================================================
--- src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php
+++ src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php
@@ -116,6 +116,14 @@
'When constructing clone URIs to show to users, Diffusion by '.
'default will not display a port assuming the default for your '.
'VCS. Explicitly declare when running on a non-standard port.')),
+ $this->newOption('diffusion.render-time-limit', 'int', null)
+ ->setSummary(pht('Time limit to render single file when browsing.'))
+ ->setDescription(
+ pht(
+ 'Rendering a file in diffusion browser could take a while.'.
+ 'This option limits time to render file. If this limit is '.
+ 'exceeded rendering finished and information being printed '.
+ 'about that the file is not fully displayed.')),
);
}
Index: src/applications/diffusion/controller/DiffusionBrowseFileController.php
===================================================================
--- src/applications/diffusion/controller/DiffusionBrowseFileController.php
+++ src/applications/diffusion/controller/DiffusionBrowseFileController.php
@@ -616,7 +616,33 @@
($show_blame),
$engine);
+ $time_limit = PhabricatorEnv::getEnvConfig('diffusion.render-time-limit');
+ if ($time_limit) {
+ $time_start = microtime(true);
+ $counter = 0;
+ }
foreach ($display as $line) {
+ // We on;y check timer once in a while, this saves some time being spent
+ // on getting value of the clock.
+ if ($time_limit) {
+ if ($counter % 10) {
+ if (microtime(true) - $time_start > $time_limit) {
+ $rows[] = phutil_tag(
+ 'tr',
+ array(),
+ array(
+ phutil_tag('th', array(), ''),
+ phutil_tag(
+ 'td', array('align' => 'center'),
+ phutil_tag(
+ 'i',
+ array(),
+ 'File has been trunkated on display'))));
+ break;
+ }
+ }
+ $counter++;
+ }
$line_href = $drequest->generateURI(
array(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 28, 5:55 PM (7 h, 38 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6940611
Default Alt Text
D8040.diff (2 KB)
Attached To
Mode
D8040: Option to truncate files on display in diffusion
Attached
Detach File
Event Timeline
Log In to Comment