bdecentgmbh / moodle-mod_pulse

Automate workflows in your courses to improve student engagement and compliance.
https://bdecent.de/pulse
GNU General Public License v3.0
10 stars 4 forks source link

Adhoc Task Backlog - \mod_pulse\task\sendinvitation #26

Open davidpesce opened 1 year ago

davidpesce commented 1 year ago

Moodle: 3.9.22 PHP: 7.4.33 Scheduled task cron: run every minute

We recently installed mod_pulse and noticed a drastic increase in our mdl_task_adhoc table. Drastic in the order of 10GB in just that table alone. Our CRON runs every minute and there are plenty of resources available to process tasks.

The adhoc task is the \mod_pulse\task\sendinvitation, which is a capability that we don't use.

Any idea what would be causing this to occur?

davidpesce commented 1 year ago

Upon further investigation, it doesn't look like the enable/disable aspect of "Send Pulse notification" is valid. It spawns a notification within adhoc tasks regardless of that setting.

The quick fix (if you don't use this to notify users) is to disable the mod_pulse\task\notify_user scheduled task within Moodle. This will stop the spawning of the sendinvitation adhoc task.

If you do need to notify users, you can spawn additional adhoc task processors (https://docs.moodle.org/402/en/Cron#Scaling_up_cron_with_multiple_processes) to keep up with the overflow of sendinvitations.

The ideal scenario would be that the activity setting to enable/disable ("Send Pulse notification") would be respected and the tasks would not be spawned at all.

stefanscholz commented 1 year ago

Hi @davidpesce ,

thanks for reporting this issue and sharing the results of your investigation. Could you please let me know which version of Pulse you are using?

We have introduced several improvements in recent versions of Pulse, but since you mention that you are still on 3.9, you might also still Pulse 1.1, am I right?

I'll ask one of the developers to review your suggestion though.

Thanks Stefan

davidpesce commented 1 year ago

Hi Stefan, It was a Moodle 3.9.x instance but has now been updated to 4.1.5+ with the latest mod_pulse (1.2). We were using v1.11 on the 3.9.x.