Skip to content

Commit

Permalink
fixed data structure for stager POST jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
hurngchunlee committed Aug 8, 2024
1 parent 11c15c3 commit 4e6f5d3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
12 changes: 8 additions & 4 deletions streamer/lib/modalityMEG.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,13 @@ var _execStreamerJob = function(name, config, job, cb_remove, cb_done) {

// here we get the collection namespace for the project
var rpost_args = {
headers: { 'Accept': 'application/json',
'Content-Type': 'application/json' },
data: []
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
data: {
jobs: []
}
};

if ( src_list.length == 0 ) {
Expand All @@ -412,7 +416,7 @@ var _execStreamerJob = function(name, config, job, cb_remove, cb_done) {

for( var i=0; i<src_list.length; i++ ) {
// add job data to post_args
rpost_args.data.push({
rpost_args.data.jobs.push({
"drUser": utility.getOuFromCollName(rdata.collName) + "[email protected]",
"dstURL": dst_list[i],
"srcURL": src_list[i],
Expand Down
6 changes: 4 additions & 2 deletions streamer/lib/modalityMRI.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,10 @@ var _execStreamerJob = function(name, config, job, cb_remove, cb_done) {
}

var rpost_args = {
headers: { 'Accept': 'application/json',
'Content-Type': 'application/json' },
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
data: {
"drUser": utility.getOuFromCollName(rdata.collName) + "[email protected]",
"dstURL": _mkDst(src, rdata.collName),
Expand Down
12 changes: 8 additions & 4 deletions streamer/lib/modalityUSER.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,13 @@ var _execStreamerJob = function(name, config, job, cb_remove, cb_done) {

// here we get the collection namespace for the project
var rpost_args = {
headers: { 'Accept': 'application/json',
'Content-Type': 'application/json' },
data: []
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
data: {
jobs: []
}
};

// construct destination collection
Expand All @@ -298,7 +302,7 @@ var _execStreamerJob = function(name, config, job, cb_remove, cb_done) {
}

// compose POST data for submitting stager jobs
rpost_args.data.push({
rpost_args.data.jobs.push({
"drUser": utility.getOuFromCollName(rdata.collName) + "[email protected]",
"dstURL": dst,
"srcURL": src,
Expand Down

0 comments on commit 4e6f5d3

Please sign in to comment.