Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
0b5dccaa
Commit
0b5dccaa
authored
May 10, 2019
by
Markus Scheidgen
Browse files
Use a huge buffered reader for package from tar command.
parent
fe09d275
Pipeline
#48077
failed with stages
in 29 minutes and 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/migration.py
View file @
0b5dccaa
...
...
@@ -39,6 +39,7 @@ import threading
from
contextlib
import
contextmanager
import
shutil
import
random
import
io
from
nomad
import
utils
,
infrastructure
,
files
,
config
from
nomad.coe_repo
import
User
,
Calc
,
LoginException
...
...
@@ -303,7 +304,8 @@ class Package(Document):
"""
logger
=
utils
.
get_logger
(
__name__
)
tf
=
tarfile
.
TarFile
.
open
(
source_tar_path
,
copybufsize
=
1024
*
1024
)
# type: ignore
f
=
io
.
open
(
source_tar_path
,
'rb'
,
buffering
=
2100000000
)
tf
=
tarfile
.
TarFile
.
open
(
fileobj
=
f
,
copybufsize
=
1024
*
1024
)
# type: ignore
if
offset
is
not
None
:
tf
.
offset
=
offset
# type: ignore
...
...
@@ -498,7 +500,11 @@ class Package(Document):
if
current_package
is
not
None
:
current_package
.
close
(
True
)
finally
:
tf
.
close
()
try
:
tf
.
close
()
f
.
close
()
except
Exception
:
pass
@
classmethod
def
get_packages
(
...
...
Write
Preview
Supports
Markdown
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