AnsweredAssumed Answered

JavaScript: GP Task being called multiple times

Question asked by Natalie on Jan 8, 2015
Latest reply on Jan 12, 2015 by Natalie

I have a GP task that is called within a JS webpage. When I click the button to run the task, it frequently starts up multiple version of the task as shown in the following console logs:

 

(for context, FP13 is the js page; line 927 is "console.log(jobInfo.jobStatus);" and the '2' or other number that sometimes occurs in front of the output indicates that that statement has been console.logged that many times in succession)

 

2FP13.js:927 esriJobSubmitted

FP13.js:927 esriJobExecuting

FP13.js:927 esriJobSubmitted

FP13.js:927 esriJobExecuting

2FP13.js:927 esriJobSubmitted

2FP13.js:927 esriJobExecuting

FP13.js:927 esriJobSubmitted

FP13.js:927 esriJobExecuting

FP13.js:927 esriJobSubmitted

FP13.js:927 esriJobExecuting

2FP13.js:927 esriJobSubmitted

FP13.js:927 esriJobExecuting

FP13.js:927 esriJobSubmitted

2FP13.js:927 esriJobExecuting

2FP13.js:927 esriJobSubmitted

FP13.js:927 esriJobExecuting

FP13.js:927 esriJobSubmitted

2FP13.js:927 esriJobExecuting

FP13.js:927 esriJobSubmitted

FP13.js:927 esriJobExecuting

FP13.js:927 esriJobSubmitted

FP13.js:927 esriJobExecuting

2FP13.js:927 esriJobSubmitted

2FP13.js:927 esriJobExecuting

FP13.js:927 esriJobSubmitted

FP13.js:927 esriJobExecuting

FP13.js:927 esriJobSubmitted

FP13.js:927 esriJobExecuting

FP13.js:927 esriJobSubmitted

31FP13.js:927 esriJobExecuting

FP13.js:927 esriJobFailed

FP13.js:932 esriJobFailed

19FP13.js:927 esriJobExecuting

FP13.js:927 esriJobSucceeded

FP13.js:932 esriJobSucceeded (etc etc)

 

So you can see that the task was sumbitted multiple times and is running many of these concurrently. Some of them succeed, some of them fail. There is no consistency to the number of times a job is sumbitted - it might be once, twice, or any number.

 

The GP task is called with: gpEvent.submitJob(paramsEvent, eventCompleteCallback, eventStatusCallback);

The parameters are unlikely to be the problem because doesn't behave consistently even when the parameters are identical.

 

Has anyone come across this behaviour before? And how do I fix it?

 

I am running the GP service from a 10.2.1 server and testing primarily in Chrome using the 3.11 API build.

 

Many thanks!

Natalie    

Outcomes