Answers.Body: <p>Not entirely sure how searching for activity create hook would help in your case ( which sounds like a DB optimization issue ).</p>
  <p>However, let's  shoot in the dark and see where it leads us: what if you try to disable the &quot;Enable CiviMail to create activities on delivery&quot; option on this page civicrm/admin/setting/preferences/mailing?reset=1 ?  Would this make your mailings faster and the database more responsive?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-11T10:25:14.763Z
Answers.Text: Yes, this makes mails sendin blazingly fast :-) But I wan't to make it work as it should, because we have lot of installs and only on this one we have problem...
Answers.UserDisplayName: Artur Śmigielski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-11T10:45:21.203Z
Answers.Text: Great to hear a fast band-aid helped. I still think you may want to check things on  your database side first, maybe use some well-known DB optimization tools & techniques and point the finger at civi after that. What I'm saying is, I can't remember experiencing issues like yours across any projects under my management, even on shared hostings. Not sure if it helps, however you may want to explore options here: Settings - CiviMail
Answers.UserDisplayName: yurg
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-10T14:04:33.330Z
Answers.LastActivityDate: 2023-12-10T14:04:33.330Z
Answers.UserDisplayName: yurg
Body: <p>I'm looking for any code to find hooks called for edit activity.</p>
  <p>Problem we have occurs whil sending mailing, that tooks 1-2min for one send email, I've made some debug and found that this code slows</p>
  <p><strong>/CRM/Mailing/BAO/MailingJob.php::writeToDB</strong>, Bulk Email activity</p>
  <pre><code>$activity = civicrm_api3('Activity', 'create', $activity);
  Params:
  Array(
      [source_contact_id] =&gt; 12311
      [activity_type_id] =&gt; 19
      [source_record_id] =&gt; 2082
      [activity_date_time] =&gt; 20231205095113
      [subject] =&gt; Zaproszenie
      [status_id] =&gt; Completed
      [campaign_id] =&gt;
      [id] =&gt; 2660265
  
  )
  </code></pre>
  <p>I've found that 'civi.api.respond' for this update takes lot of time...</p>
  <p>Is there any way to find wich hooks are called while this api3 call ?
  I've added some debug code in civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php::callListeners</p>
  <pre><code>\Civi::log()-&gt;notice('callListener: ', $listener);
  </code></pre>
  <p>But it's not helping..</p>
  
Tags: <civimail><activities>
Title: CiviCRM find all hooks for Event
ThreadText: # CiviCRM find all hooks for Event
  
  (Asked by: username_0 on 2023-12-10)
  
  I'm looking for any code to find hooks called for edit activity.
  Problem we have occurs whil sending mailing, that tooks 1-2min for one send email, I've made some debug and found that this code slows
  /CRM/Mailing/BAO/MailingJob.php::writeToDB, Bulk Email activity
  $activity = civicrm_api3('Activity', 'create', $activity);
  Params:
  Array(
      [source_contact_id] => 12311
      [activity_type_id] => 19
      [source_record_id] => 2082
      [activity_date_time] => 20231205095113
      [subject] => Zaproszenie
      [status_id] => Completed
      [campaign_id] =>
      [id] => 2660265
  
  )
  
  I've found that 'civi.api.respond' for this update takes lot of time...
  Is there any way to find wich hooks are called while this api3 call ?
  I've added some debug code in civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php::callListeners
  \Civi::log()->notice('callListener: ', $listener);
  
  But it's not helping..
  
  **Tags:** civimail, activities
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-12-10. Score: 1
  
  Not entirely sure how searching for activity create hook would help in your case ( which sounds like a DB optimization issue ).
  
  However, let's shoot in the dark and see where it leads us: what if you try to disable the "Enable CiviMail to create activities on delivery" option on this page civicrm/admin/setting/preferences/mailing?reset=1 ? Would this make your mailings faster and the database more responsive?
  
  > **Comments:**
  > **username_0**: Yes, this makes mails sendin blazingly fast :-) But I wan't to make it work as it should, because we have lot of installs and only on this one we have problem...  
  > **username_1**: Great to hear a fast band-aid helped. I still think you may want to check things on  your database side first, maybe use some well-known DB optimization tools & techniques and point the finger at civi after that. What I'm saying is, I can't remember experiencing issues like yours across any projects under my management, even on shared hostings. Not sure if it helps, however you may want to explore options here: Settings - CiviMail  
  
  ---
  
  