Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
433702f4
Commit
433702f4
authored
Nov 20, 2023
by
Jeffrey Morgan
Browse files
hide progress stats on completion
parent
6066c70e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
progress/bar.go
progress/bar.go
+11
-3
No files found.
progress/bar.go
View file @
433702f4
...
...
@@ -118,17 +118,25 @@ func (b *Bar) percent() float64 {
}
func
(
b
*
Bar
)
Stats
()
Stats
{
if
time
.
Since
(
b
.
statted
)
<
time
.
Second
||
b
.
currentValue
>=
b
.
maxValue
{
if
time
.
Since
(
b
.
statted
)
<
time
.
Second
{
return
b
.
stats
}
if
b
.
statted
.
IsZero
()
{
switch
{
case
b
.
statted
.
IsZero
()
:
case
b
.
currentValue
>=
b
.
maxValue
:
b
.
stats
=
Stats
{
value
:
b
.
maxValue
,
rate
:
0
,
remaining
:
0
,
}
case
b
.
statted
.
IsZero
()
:
b
.
stats
=
Stats
{
value
:
b
.
initialValue
,
rate
:
0
,
remaining
:
0
,
}
}
else
{
default
:
rate
:=
b
.
currentValue
-
b
.
stats
.
value
var
remaining
time
.
Duration
if
rate
>
0
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment