README.txt

  1. 7.x README.txt
  2. 7.x custom/files/README.txt
  3. 7.x modules/student_files/README.txt
  4. 7.x modules/encryption/README.txt
  5. 7.x modules/prereqs/README.txt
  6. 7.x modules/batch/README.txt
  7. 7.x modules/tinymce/README.txt
  8. 7.x modules/lassie/README.txt
  9. 7.x themes/how_to_customize/README.txt
  10. 6.x README.txt
  11. 6.x modules/tinymce/README.txt
  12. 6.x modules/student_files/README.txt
  13. 6.x modules/batch/README.txt
  14. 6.x modules/lassie/README.txt
  15. 6.x modules/prereqs/README.txt
  16. 6.x themes/how_to_customize/README.txt
  17. 6.x modules/encryption/README.txt
  18. 6.x custom/files/README.txt
  19. 4.x README.txt
  20. 4.x modules/tinymce/inc/tiny_mce/plugins/style/readme.txt
  21. 4.x modules/tinymce/README.txt
  22. 5.x README.txt
  23. 5.x modules/tinymce/README.txt
  24. 5.x modules/batch/README.txt
  25. 5.x themes/basic/README.txt
  26. 5.x inc/pchart/README.txt
  27. 5.x inc/pchart/pchart/readme.txt
  28. 5.x modules/tinymce/inc/tiny_mce/plugins/style/readme.txt
Lassie
========================
Richard Peacock (flightpathacademics.com)


DESCRIPTION

The Lassie modue is meant to be used by module and routine developers,
to monitor long-running jobs and to make sure they finish within the expected
amount of time.

If a job doesn't finish, Lassie will email an admin user to warn them.

This module is very useful for making sure a nightly routine finished without errors.


REQUIREMENTS
In order to function correctly, you should set your site's cron to run at least once per hour.



USE
In your code, "start" a job for Lassie to monitor like so:

  lassie_start($job_name, $hours, $emails);

* $job_name must be a machine name (no spaces or unusual characters) unique to this job.

* $hours is an INTEGER (whole number-- no decimals) which tells Lassie how long we *expect* the job to take to run.  If we do not finish
  within this number of hours, the email addresses will be notified.

* $emails is an optional list of emails addresses (separated by comma) to notify if the job fails to end by $hours.


To tell Lassie that you have finished the job, always end your routine with:

  lassie_finish($job_name);
  
  
  
EXTRA
If you wish Lassie to automatically disable "maintenance mode" when a job fails, then add the following to
your custom/settings.php file (in the "Custom Settings" area):

    $GLOBALS['lassie_disable_maintenance_mode_on_fail'] = TRUE;
    
NOTE:  You can also add this right before calling lassie_start(), if you would prefer it be configured per-job.    
    
This is useful if a routine fails to complete, but you do not want the maintenance mode message to be continued to be displayed.

File

modules/lassie/README.txt
View source
  1. Lassie
  2. ========================
  3. Richard Peacock (flightpathacademics.com)
  4. DESCRIPTION
  5. The Lassie modue is meant to be used by module and routine developers,
  6. to monitor long-running jobs and to make sure they finish within the expected
  7. amount of time.
  8. If a job doesn't finish, Lassie will email an admin user to warn them.
  9. This module is very useful for making sure a nightly routine finished without errors.
  10. REQUIREMENTS
  11. In order to function correctly, you should set your site's cron to run at least once per hour.
  12. USE
  13. In your code, "start" a job for Lassie to monitor like so:
  14. lassie_start($job_name, $hours, $emails);
  15. * $job_name must be a machine name (no spaces or unusual characters) unique to this job.
  16. * $hours is an INTEGER (whole number-- no decimals) which tells Lassie how long we *expect* the job to take to run. If we do not finish
  17. within this number of hours, the email addresses will be notified.
  18. * $emails is an optional list of emails addresses (separated by comma) to notify if the job fails to end by $hours.
  19. To tell Lassie that you have finished the job, always end your routine with:
  20. lassie_finish($job_name);
  21. EXTRA
  22. If you wish Lassie to automatically disable "maintenance mode" when a job fails, then add the following to
  23. your custom/settings.php file (in the "Custom Settings" area):
  24. $GLOBALS['lassie_disable_maintenance_mode_on_fail'] = TRUE;
  25. NOTE: You can also add this right before calling lassie_start(), if you would prefer it be configured per-job.
  26. This is useful if a routine fails to complete, but you do not want the maintenance mode message to be continued to be displayed.