Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14078497
D12081.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12081.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12081: Allow callers to explicitly request a progress bar redraw
Attached
Detach File
Event Timeline
Log In to Comment