Krang::Schedule::Action::clean - Scheduler Action class which implements scheduled cleanup and maintenance functions
Concrete Krang::Scheduler::Action class which deletes expired sessions, cleans out tmp directories, or mysql table maintenance.
This class is used to do scheduled maintenance. It is instantiated in the scheduler depending on action type.
use Krang::ClassLoader base => 'Schedule::Action'; sub execute { }
$schedule->execute()
@deletions = pkg('Schedule')->_clean_tmp( max_age => $max_age_hrs )
@deletions = pkg('Schedule')->_clean_tmp()
Class method that will remove all files in $KRANG_ROOT/tmp older than $max_age_in_hours. If no parameter is passed file and directories older than 24 hours will be removed. This method will croak if it is unable to delete a file or directory. Returns a list of files and directories deleted.
pkg('Schedule')->_expire_sessions()@ids = pkg('Schedule')->_expire_sessions()
Class method that deletes sessions from the sessions table whose 'last_modified' field contains a value less than 'now() - INTERVAL $max_age_in_hours HOUR'. Returns a list of the session ids that have been expired.
If max_age is not supplied, defaults to 24 hours.
$schedule->_analyze_db()_analyze_db() - analyzes all database tables for maximum performance
$schedule->_delete_files()pkg('Schedule')->_expire_rate_limit_data()time() + BadLoginWait
pkg('Schedule')->_expire_rate_limit_data()