0

for example, a schedulable that run two call-out functions like:

global class scheduletest implements Schedulable {
   global void execute(SchedulableContext sc) {
      callOutFunction(a);
      callOutFunction(b);
   }
}

I need to do it like that because if I run the function only once, it exceeds the runtime, so I am considering running the callout twice to get the response body in parts.

1 Answer 1

2

It can. It depends on what exactly your Apex code is doing and how long each callout takes.

Assuming each function makes exactly one callout, the primary governor limit to be concerned about is probably

Maximum timeout for all callouts (HTTP requests or Web services calls) in a transaction: 120 seconds

If you are not changing the default timeout of 10 seconds per callout and are making 2 callouts, you won't hit that, but your description suggests that you probably have increased the callout timeout (the maximum for which is 120 seconds each, meaning two such callouts could easily hit the limit).

Note as well that all other Asynchronous Apex limits will continue to apply, such as CPU time, SOQL query, and DML.

Additionally, if the first method performs any DML after its callout to persist results, your second method won't be able to make a callout because DML has already occurred in the transaction.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .