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
b2bea118
authored
Jan 27, 2021
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'export_import_fixes' into 'master'
Export import fixes See merge request
!20
parents
899f5736
0f93a752
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
disk.py
+6
-6
No files found.
disk.py
View file @
b2bea118
...
@@ -278,14 +278,14 @@ class Disk(object):
...
@@ -278,14 +278,14 @@ class Disk(object):
f
.
write
(
chunk
)
f
.
write
(
chunk
)
current_size
=
f
.
tell
()
current_size
=
f
.
tell
()
new_percent
=
current_size
*
100
/
clen
new_percent
=
current_size
*
100
/
clen
if
task
.
is_aborted
():
raise
AbortException
()
if
new_percent
>
percent
:
if
new_percent
>
percent
:
if
task
.
is_aborted
():
raise
AbortException
()
percent
=
new_percent
percent
=
new_percent
task
.
update_state
(
task
.
update_state
(
task_id
=
parent_id
,
task_id
=
parent_id
,
state
=
task
.
AsyncResult
(
parent_id
)
.
state
,
state
=
task
.
AsyncResult
(
parent_id
)
.
state
,
meta
=
{
'percent'
:
percent
}
meta
=
{
'
size'
:
current_size
,
'
percent'
:
percent
}
)
)
with
magic
.
Magic
()
as
m
:
with
magic
.
Magic
()
as
m
:
...
@@ -337,14 +337,14 @@ class Disk(object):
...
@@ -337,14 +337,14 @@ class Disk(object):
def
update_state
(
monitor
):
def
update_state
(
monitor
):
new_percent
=
monitor
.
bytes_read
*
100
/
size
new_percent
=
monitor
.
bytes_read
*
100
/
size
if
task
.
is_aborted
():
raise
AbortException
()
if
new_percent
>
percent
[
0
]:
if
new_percent
>
percent
[
0
]:
if
task
.
is_aborted
():
raise
AbortException
()
percent
[
0
]
=
new_percent
percent
[
0
]
=
new_percent
task
.
update_state
(
task
.
update_state
(
task_id
=
parent_id
,
task_id
=
parent_id
,
state
=
task
.
AsyncResult
(
parent_id
)
.
state
,
state
=
task
.
AsyncResult
(
parent_id
)
.
state
,
meta
=
{
'percent'
:
percent
[
0
]}
meta
=
{
'
size'
:
monitor
.
bytes_read
,
'
percent'
:
percent
[
0
]}
)
)
with
open
(
exported_path
,
'rb'
)
as
exported_disk
:
with
open
(
exported_path
,
'rb'
)
as
exported_disk
:
...
...
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