Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
migration_scripts
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
serpucga
migration_scripts
Commits
9ba7bac1
Commit
9ba7bac1
authored
Jul 24, 2019
by
serpucga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extended error detection
parent
888acbe2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
pymongoexport_csv.py
pymongoexport_csv.py
+17
-8
No files found.
pymongoexport_csv.py
View file @
9ba7bac1
...
...
@@ -86,11 +86,15 @@ def process_data_page(
# Launch single process to write to the filesystem
writer_worker
=
mp
.
Process
(
target
=
utils
.
filesystem_writer
,
args
=
(
task_queue
,
header
,
args
.
host
,
args
.
port
,
args
.
database
,
args
.
pagesize
,
output_dir
,
args
.
recovery
))
writer_worker
.
start
()
try
:
writer_worker
=
mp
.
Process
(
target
=
utils
.
filesystem_writer
,
args
=
(
task_queue
,
header
,
args
.
host
,
args
.
port
,
args
.
database
,
args
.
pagesize
,
output_dir
,
args
.
recovery
))
writer_worker
.
start
()
except
Exception
:
logger
.
error
(
"There was a failure in the filesystem writer"
,
exc_info
=
True
)
sys
.
exit
(
1
)
# Launch pool of workers to perform the format conversion
try
:
...
...
@@ -101,7 +105,7 @@ except utils.ExceptionAtPage as exc:
task_queue
.
put
((
exc
.
error_page
,
"ERROR"
))
sys
.
exit
(
1
)
except
(
Exception
,
KeyboardInterrupt
):
logger
.
error
(
"Error detected"
)
logger
.
error
(
"Error detected"
,
exc_info
=
True
)
task_queue
.
put
((
-
2
,
"ERROR"
))
sys
.
exit
(
1
)
...
...
@@ -110,8 +114,13 @@ task_queue.put((-1, "END"))
if
globals
.
timing
:
time1
=
time
.
time
()
utils
.
generate_metadata_file
(
output_dir
)
logger
.
info
(
"Metadata file created"
)
try
:
utils
.
generate_metadata_file
(
output_dir
)
logger
.
info
(
"Metadata file created"
)
except
(
Exception
,
KeyboardInterrupt
):
logger
.
error
(
"The collection was converted correctly to CSV, but something"
+
" failed when generating the metadata file"
,
exc_info
=
True
)
sys
.
exit
(
1
)
if
globals
.
timing
:
logger
.
critical
(
"Time spent generating metadata file: {}s"
...
...
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