0

This is strange for me and a new information to me. But calling a batch or recursively calling a batch is contributing to API Requests of org.

enter image description here

I did test this in my own dev org, where no external apis are being hit and no scheduled job is firing a callout.

Everytime I refresh the screen API requests increases by 1-2, and after sometime it does not increase, after that I wrote a recursive batch to prove my theory.

global class RiderInsertInBatch implements Database.Batchable<Integer>{
    global Iterable<Integer> start(Database.BatchableContext info){
        return new IntegerIterator(1);
    }

    global void execute(Database.BatchableContext info, List<Integer> scope){
    }

    global void finish(Database.BatchableContext info){
        Database.executeBatch(new RiderInsertInBatch());
    }
}

And to my surprise the API requests increased by 500 in less than few minutes. I am not sure why, but is this because Batch or any async operation happens on another server outside of the org. So to execute a batch the other server might be firing a REST/POST call to org to execute it.

9
  • It could be a case that developer console is using API limits -> trailblazer.salesforce.com/ideaView?id=08730000000kxbZAAQ
    – kurunve
    Jul 29 at 9:57
  • But that should be just one api call to call the batch once. Right? Jul 29 at 10:35
  • Not if it is fetching an API logs
    – kurunve
    Jul 29 at 11:34
  • 1
    I agree with @kurunve, something else is going on. Most likely something monitoring debug logs. Developer Console uses a load of API to show you the latest logs. Maybe your IDE could be doing it? The API Usage Report will probably give you more info help.salesforce.com/…
    – Aidan
    Jul 29 at 13:01
  • 1
    it should be available (my DE org has it) - key is that you'll have to switch to classic to see it in the Administrative Reports folder. Jul 29 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.