javascript - Parse background job add multiple record causing error -
I'm getting a weird error. Failure with
: Error: Success / Error Many calls can not be made from objects. Object (from time to time) on updates in success (: 826: 9). Recovery (: 795: 5) Here's my code.
Parse.Cloud.job ("jobAddTags", function (request, position) {var array = request.params.tagArray; for (var i = 0; i & lt; array.length ; I ++) {query = new pars.queryue ("tag"); query.limit (1); query.find ({success: work} {if object} {// update object.increment (" Count "); object.save ();} else {console.log (" add new "); var tag = Parse.Object (" tag "); tag activity (new), tag activity (" tag ", request. Object.get ("tag"); tag.save ();} // end else}, / / end success error: function (error) {status.error ("oh oh, something went wrong." + Error .code + ":" + error.message);} // end find}); status.success ("end tag");
move your status.success down so that it Out of the loop:
... error: function (error) {status.error ("oh oh, something went wrong." Error.code + ":" + Error. );} // and get}};} end for // status.success ("adding tag is accomplished"); }); // And Job
Comments
Post a Comment