Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
storagedriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
4
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6bbfb683
authored
Jan 27, 2021
by
Máhonfai Bálint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check abort only if percentage changed
This avoids checking abort too frequently.
parent
899f5736
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
disk.py
+2
-2
No files found.
disk.py
View file @
6bbfb683
...
...
@@ -278,9 +278,9 @@ class Disk(object):
f
.
write
(
chunk
)
current_size
=
f
.
tell
()
new_percent
=
current_size
*
100
/
clen
if
new_percent
>
percent
:
if
task
.
is_aborted
():
raise
AbortException
()
if
new_percent
>
percent
:
percent
=
new_percent
task
.
update_state
(
task_id
=
parent_id
,
...
...
@@ -337,9 +337,9 @@ class Disk(object):
def
update_state
(
monitor
):
new_percent
=
monitor
.
bytes_read
*
100
/
size
if
new_percent
>
percent
[
0
]:
if
task
.
is_aborted
():
raise
AbortException
()
if
new_percent
>
percent
[
0
]:
percent
[
0
]
=
new_percent
task
.
update_state
(
task_id
=
parent_id
,
...
...
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