Internal overhaul

This commit is contained in:
Deon George
2013-11-28 17:41:34 +11:00
parent 0ed5e5163d
commit f8a5b153cf
91 changed files with 1570 additions and 1619 deletions

View File

@@ -24,7 +24,7 @@ class Controller_Admin_Task extends Controller_Task {
->title(_('Task Log'))
->title_icon('icon-th-list')
->body(Table::factory()
->page_items(50)
->page_items(50)
->data(ORM::factory('Task_Log')->find_all())
->columns(array(
'id'=>'ID',
@@ -32,8 +32,7 @@ class Controller_Admin_Task extends Controller_Task {
'task->display("name")'=>'Task',
'result'=>'Result',
'message'=>'Message',
))
);
)));
}
}
?>

View File

@@ -17,41 +17,47 @@ class Task_Task_Clean extends Minion_Task {
foreach ($tl->find_all() as $to) {
// Delete Task already running messages.
if (preg_match('/^Task\ [0-9]+\ is already running$/',$to->message) AND $to->date_orig < time()+$delay) {
if (preg_match('/^Task\ [0-9]+\ is already running$/',$to->message) AND $to->date_orig < time()-$delay) {
$to->delete();
continue;
}
// Delete Empty Invoices Sent
if (preg_match('/^Invoices Sent:\s+$/',$to->message) AND $to->date_orig < time()+$delay) {
if (preg_match('/^Invoices Sent:\s+$/',$to->message) AND $to->date_orig < time()-$delay) {
$to->delete();
continue;
}
// Delete Overdue Notes Sent
if (preg_match('/^OverDue Notice #[0-9] Reminders Sent:\s+$/',$to->message) AND $to->date_orig < time()+$delay) {
if (preg_match('/^OverDue Notice #[0-9] Reminders Sent:\s+$/',$to->message) AND $to->date_orig < time()-$delay) {
$to->delete();
continue;
}
// Over Notes Sent
if (preg_match('/^(Overdue|Due) Reminders Sent:\s+$/',$to->message) AND $to->date_orig < time()+$delay) {
if (preg_match('/^(Overdue|Due) Reminders Sent:\s+$/',$to->message) AND $to->date_orig < time()-$delay) {
$to->delete();
continue;
}
// Services Invoiced
if (preg_match('/^Services Invoiced:\s+$/',$to->message) AND $to->date_orig < time()+$delay) {
if (preg_match('/^Services Invoiced:\s+$/',$to->message) AND $to->date_orig < time()-$delay) {
$to->delete();
continue;
}
if (in_array($to->task_id,array(2,4,13)) AND $to->date_orig < time()+$delay) {
// Alerts Sent
if (preg_match('/^0 alerts sent \(\)$/',$to->message) AND $to->date_orig < time()-$delay) {
$to->delete();
continue;
}
if (in_array($to->task_id,array(3)) AND $to->date_orig < time()+86400*60) {
if (in_array($to->task_id,array(4,13)) AND $to->date_orig < time()-$delay) {
$to->delete();
continue;
}
if (in_array($to->task_id,array(3)) AND $to->date_orig < time()-86400*60) {
$to->delete();
continue;
}
@@ -63,7 +69,7 @@ class Task_Task_Clean extends Minion_Task {
OR preg_match('/View_Exception\s+/',$to->message)
OR preg_match('/Kohana_Exception\s+/',$to->message))
AND $to->date_orig < time()+$delay) {
AND $to->date_orig < time()-$delay) {
$to->delete();
continue;