function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Urgent: Internal Salesforce Error for following apex class.

It was working fine till yesterday. Suddenly its giving me the above error in DEBUG Logs and in Apex jobs page it gives First error: AsyncApexExecutions Limit exceeded.

can some one please help me.
Thanks in advance.

global class DEREDistributer implements Database.Batchable<sObject>, Database.AllowsCallouts,Database.stateful {
  global integer x=0;

global Database.QueryLocator start(Database.BatchableContext BC) {
        String query = 'SELECT Name,Times_The_Lead_Is_Distributed__c,Hawaii__c,SV_Priority_Hidden__c, Id, AssignToUserId_Hidden__c FROM Lead WHERE IsConverted =false and Hawaii__c = false and To_Be_Distributed__c=true and DE_Synched__c=true and Is_Distributed__c =True ';
        return Database.getQueryLocator(query);
  global void execute(Database.BatchableContext BC, List<Lead> scope) {
  List<Team1__c> L1 = [SELECT Name,CheckIn__c From Team1__c Where CheckIn__c = True]; 
  integer i = L1.size();
integer z=1;

//Initialize the AZ Qualification Team   
  for(Team1__c L2 :[SELECT Name,CheckIn__c,UserId__c From Team1__c] )
  If(L2.CheckIn__c == True)
     L2.UserId__c = z++;
     update L2;
  L2.UserId__c =0;
  update L2;
  for (Lead e : scope) {
//assingn user id,distribution count and distributed flag.   
  decimal y =  e.Times_The_Lead_Is_Distributed__c;
  e.AssignToUserId_Hidden__c = math.MOD(x, i) + 1;
  e.Is_Distributed__c =True;
   e.Times_The_Lead_Is_Distributed__c = y +1;

      Update scope;
  global void finish(Database.BatchableContext BC) { }
Have you implemented any new functionality recently which involved future methods. Something has changed within your environment, since this was working before, I would start by looking at any additions to your codebase, either new future operations or code that could more freuquently trigger future operations.