Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #181: Queue adhoc tasks by duration #183

Merged

Conversation

djarran
Copy link
Contributor

@djarran djarran commented Nov 21, 2024

Description: This resolves issue #181 by changing the SQL used to retrieve the re-engagement modules. No functional changes.

Testing instructions:

  1. Cherry pick the changes in Fix #180: Check if adhoc tasks are queued before log output #186 (both can be tested at the same time)
  2. Create new test course
  3. Enable activity completion
  4. Add re-engagement module
  5. Under 'Completion conditions', select a reengagement duration of 1 week
  6. Add another re-engagement module and select a duration of 1 hour
  7. Execute the cron task with php admin/cli/scheduled_task.php --execute=mod_reengagement\\task\\cron_task
  8. Confirm that the output message looks like this, where the first module queued should have a higher ID:
Execute scheduled task: Reengagement cron task (mod_reengagement\task\cron_task)
... started 00:18:38. Current memory use 18.1 MB.
Queued re-engagement module: (rid: 2, cmid: 66)
Queued re-engagement module: (rid: 1, cmid: 65)
  1. Run the task again and confirm that the tasks were not added to the queue (skipped)
Execute scheduled task: Reengagement cron task (mod_reengagement\task\cron_task)
... started 00:43:37. Current memory use 18.1 MB.
Skipped queueing re-engagement module: (rid: 2, cmid: 66)
Skipped queueing re-engagement module: (rid: 1, cmid: 65)

@gbarat87
Copy link

This looks good to me, working as expected

@danmarsden danmarsden merged commit c996cfc into MOODLE_405_STABLE Nov 26, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants