Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-59084

Allow adhoc tasks to be run as a specific user

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Install the supplied local plugin
      2. Run local/mdl59084/test.php
      3. Wait 5 seconds
      4. Run admin/cli/cron.php
      5. View the output
      6. Confirm:
        1. The first execution ran as the id of your admin user
        2. The second execution ran as a different user
        3. The third execution ran as the id of your admin user
        4. The fourth execution did not run and the task was cancelled:

          Execute adhoc task: local_mdl59084\task\echo_task
          ... started 03:53:48. Current memory use 6.8MB.
          User -100 could not be found for adhoc task: local_mdl59084\task\echo_task. Cancelling task.
          

        5. The fifth execution ran as the id of your admin user
        6. The sixth execution did not run and the task was cancelled:

          Execute adhoc task: local_mdl59084\task\echo_task
          ... started 03:53:48. Current memory use 6.8MB.
          User -10 cannot be used to run an adhoc task: local_mdl59084\task\echo_task. Cancelling task.
          

        7. The seventh execution ran as the id of your admin user
      1. Check for any content in the task_adhoc DB table (it should be empty)
      Show
      Install the supplied local plugin Run local/mdl59084/test.php Wait 5 seconds Run admin/cli/cron.php View the output Confirm : The first execution ran as the id of your admin user The second execution ran as a different user The third execution ran as the id of your admin user The fourth execution did not run and the task was cancelled: Execute adhoc task: local_mdl59084\task\echo_task ... started 03:53:48. Current memory use 6.8MB. User -100 could not be found for adhoc task: local_mdl59084\task\echo_task. Cancelling task. The fifth execution ran as the id of your admin user The sixth execution did not run and the task was cancelled: Execute adhoc task: local_mdl59084\task\echo_task ... started 03:53:48. Current memory use 6.8MB. User -10 cannot be used to run an adhoc task: local_mdl59084\task\echo_task. Cancelling task. The seventh execution ran as the id of your admin user Check for any content in the task_adhoc DB table (it should be empty)
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull Master Branch:
      MDL-59084-master

      Description

      We want to make more use of adhoc tasks and ideally that will involve running tasks for individual users.

      Rather than having to encode user information in the custom data of an adhoc task, it would be great if we could have it as a key field.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dobedobedoh Andrew Nicols
                Reporter:
                dobedobedoh Andrew Nicols
                Peer reviewer:
                David Mudrák (@mudrd8mz)
                Integrator:
                Dan Poltawski
                Tester:
                Damyon Wiese
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17