Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistDownloadWorkflow.php
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | public function runWorkflow() { | ||||
$data_uri = $file_ref->getDataURI(); | $data_uri = $file_ref->getDataURI(); | ||||
$future = new HTTPSFuture($data_uri); | $future = new HTTPSFuture($data_uri); | ||||
if (!$is_stdout) { | if (!$is_stdout) { | ||||
// For small files, don't bother drawing a progress bar. | // For small files, don't bother drawing a progress bar. | ||||
$minimum_bar_bytes = (1024 * 1024 * 4); | $minimum_bar_bytes = (1024 * 1024 * 4); | ||||
if ($expected_bytes > $minimum_bar_bytes) { | if ($expected_bytes > $minimum_bar_bytes) { | ||||
$progress = id(new PhutilConsoleProgressSink()) | $progress = (new PhutilConsoleProgressSink()) | ||||
->setTotalWork($expected_bytes); | ->setTotalWork($expected_bytes); | ||||
$future->setProgressSink($progress); | $future->setProgressSink($progress); | ||||
} | } | ||||
// Compute a timeout based on the expected filesize. | // Compute a timeout based on the expected filesize. | ||||
$transfer_rate = 32 * 1024; | $transfer_rate = 32 * 1024; | ||||
$timeout = (int)(120 + ($expected_bytes / $transfer_rate)); | $timeout = (int)(120 + ($expected_bytes / $transfer_rate)); | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0