How set the time out for Query Layer activity?
I have a long running query on a Map Service but it keeps timing out after 60 seconds. I've looked at the timeouts in the web.config files for both the web adaptor and GVH viewer. It doesn't look like its bumping into any of the Map Server limits? Is this hard coded in the javascipt?
-
This is the ticket, but still trying to figure out how to execute within the workflow.
require(["esri/config"], function(esriConfig) { esriConfig.defaults.io.timeout = 120000; console.log("esriConfig test"); });
0 -
Ended up creating a custom workflow activity. Below is the code that I used. The directions for creating custom activities are pretty straightforward. Although it seems to be quite a bit of coding/learning for such a simple task.
https://developers.geocortex.com/docs/workflow/overview/
import type { IActivityHandler } from "@geocortex/workflow/runtime/IActivityHandler";
import * as esriConfig from "esri/config";
/** An interface that defines the inputs of the activity. */
export interface EsriConfigTimeoutInputs {
/**
* @displayName Milliseconds
* @description Number of milliseconds for esri/config.defaults.io.timeout - default=60000.
* @required
*/
milliseconds: number;
}
/** An interface that defines the outputs of the activity. */
export interface EsriConfigTimeoutOutputs {
/**
* @description The result of the activity.
*/
result: string;
}
/**
* @displayName EsriConfigTimeout
* @category NDDOT Activities
* @description increases timeout for application using the a query layer
*/
export class EsriConfigTimeout implements IActivityHandler {
/** Perform the execution logic of the activity. */
execute(inputs: EsriConfigTimeoutInputs): EsriConfigTimeoutOutputs {
//default is 60000
esriConfig.defaults.io.timeout = inputs.milliseconds;
return {
result: `millseconds set to: ${inputs.milliseconds}}`,
};
}
}
0 -
Hi Brian,
Thanks for posting your solution. I'm glad to see you found a way to solve it. Bear in mind that this will affect the timeout for subsequent requests also, so it might be an idea to call your custom activity again afterwards to set it back.
An alternative workaround that does not involve a custom activity is to use the Web Request activity. You would need to construct the request url for the Query endpoint, but on the plus side, there is a Timeout input.
Within the Query Layer activity, we use the QueryTask API, which unfortunately does not have any way to set a timeout in the 3.x API, which is used by GVH.
If you think it would be worthwhile for us to have an activity for setting the timeout in the configuration (as you have done) then please consider adding it to our ideas page. We find it really useful in giving us a sense of how much demand there is for a particular change.
0 -
@Ken Lyon? - I probably should have used the QueryTask but I started down the custom activity road and thought it was a good way to learn how to do one.
Will add to Idea page.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
4 Kommentare