Page MenuHomePhabricator

D12081.diff
No OneTemporary

D12081.diff

diff --git a/src/console/PhutilConsoleProgressBar.php b/src/console/PhutilConsoleProgressBar.php
--- a/src/console/PhutilConsoleProgressBar.php
+++ b/src/console/PhutilConsoleProgressBar.php
@@ -68,9 +68,24 @@
private function redraw() {
if ($this->lastUpdate + 0.1 > microtime(true)) {
// We redrew the bar very recently; skip this update.
- return;
+ return $this;
}
+ return $this->draw();
+ }
+
+
+ /**
+ * Explicitly redraw the bar.
+ *
+ * Normally, the progress bar is automatically redrawn periodically, but
+ * you may want to force it to draw.
+ *
+ * For example, we force a draw after pre-filling the bar when resuming
+ * large file uploads in `arc upload`. Otherwise, the bar may sit at 0%
+ * until the first chunk completes.
+ */
+ public function draw() {
if ($this->quiet) {
return;
}
@@ -129,6 +144,8 @@
$this->eraseLine();
$console->writeErr('%s', $out);
+
+ return $this;
}
public function done($clean_exit = true) {

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 3:58 AM (18 h, 4 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6777120
Default Alt Text
D12081.diff (1 KB)

Event Timeline