Skip to content

Activity Type condition: cache triggering activity type

Currently the triggering activity's type is always (unconditionally) fetched from the database (via APIv3) on every invocation of the condition: when the trigger (e.g Activity is changed) is triggered for all contacts (source, target, assigned) or there are more targets, etc. Type is fetched even it is already available in the trigger.

This causes performance issues. For an activity with a few thousands target contact (bulk email sent activity) this takes too much time (minutes), effectively slowing down bulk email sending to an unacceptable pace.

After this MR, activity type is only retrieved if it's not already known, and after fetching it is cached in $triggerData for further invocations.

Merge request reports

Loading