Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ebulk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ebulk
Commits
7cfc2018
Commit
7cfc2018
authored
Mar 02, 2021
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround to keep backward compatibility
parent
db891b8b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
ebulk-data/embulk-wendelin-dataset-tool/lib/embulk/input/wendelin.rb
...embulk-wendelin-dataset-tool/lib/embulk/input/wendelin.rb
+1
-1
ebulk-data/embulk-wendelin-dataset-tool/lib/embulk/wendelin_client.rb
...mbulk-wendelin-dataset-tool/lib/embulk/wendelin_client.rb
+15
-4
No files found.
ebulk-data/embulk-wendelin-dataset-tool/lib/embulk/input/wendelin.rb
View file @
7cfc2018
ebulk-data/embulk-wendelin-dataset-tool/lib/embulk/wendelin_client.rb
View file @
7cfc2018
...
...
@@ -185,11 +185,15 @@ class WendelinClient
end
def
getDataStreamList
(
data_set_reference
,
data_stream_count
,
batch_size
)
#keep backward compatibility
if
data_stream_count
=
-
1
return
getDataStreams
(
data_set_reference
)
end
data_stream_list
=
[]
total_batches
=
data_stream_count
/
batch_size
.
ceil
()
if
total_batches
>
4
puts
@logger
.
warn
(
"Due to its size, the remote file list will be fetch in batches. This could take some minutes."
,
print
=
TRUE
)
@logger
.
info
(
"Due to its size, the remote file list will be fetch in batches. This could take some minutes."
,
print
=
TRUE
)
end
nbatch
=
0
while
nbatch
<=
total_batches
...
...
@@ -234,19 +238,24 @@ class WendelinClient
return
{
'status_code'
:
0
,
'result'
:
[]}
end
def
getDataStreamCount
(
data_set_reference
)
uri
=
URI
(
URI
.
escape
(
"
#{
@erp5_url
}
ERP5Site_getDataStreamCount?data_set_reference=
#{
data_set_reference
}
"
))
response
=
handleRequest
(
uri
)
if
response
[
"success"
]
==
FALSE
#keep backward compatibiliy if script doesn't exist in wendelin instance
if
response
[
"message"
]
==
404
@logger
.
info
(
"Continue with backward compatibility..."
,
print
=
TRUE
)
return
{
"status_code"
=>
0
,
"result"
=>-
1
}
else
@logger
.
abortExecution
()
end
end
str
=
response
[
"message"
]
if
not
str
.
nil?
str
.
gsub!
(
/(\,)(\S)/
,
"
\\
1
\\
2"
)
return
YAML
::
load
(
str
)
end
return
{
'status_code'
:
0
,
'result'
:
0
}
return
{
"status_code"
=>
0
,
"result"
=>
0
}
end
private
...
...
@@ -300,6 +309,8 @@ class WendelinClient
elsif
res
.
code
==
'400'
@logger
.
error
(
HTTP_MESSAGE_400
,
print
=
TRUE
)
@logger
.
abortExecution
()
elsif
res
.
code
==
'404'
return
{
"success"
=>
FALSE
,
"message"
=>
404
}
else
@logger
.
error
(
HTTP_MESSAGE_OTHER
,
print
=
TRUE
)
end
...
...
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