Zero1_Crondoctor - Version 1.0.3

Version Notes

Adding Zombie support

Download this release

Release Info

Developer Arron Moss
Extension Zero1_Crondoctor
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/community/Zero1/Crondoctor/Block/Adminhtml/Crondoctor.php CHANGED
@@ -4,6 +4,7 @@ class Zero1_Crondoctor_Block_Adminhtml_Crondoctor extends Mage_Adminhtml_Block_W
4
  public function __construct()
5
  {
6
  parent::__construct();
 
7
  $this->_removeButton('add');
8
  }
9
 
@@ -12,7 +13,7 @@ class Zero1_Crondoctor_Block_Adminhtml_Crondoctor extends Mage_Adminhtml_Block_W
12
  $this->_controller = 'adminhtml_crondoctor';
13
  $this->_blockGroup = 'zero1_crondoctor';
14
  $this->_headerText = Mage::helper('zero1_crondoctor')->__('Cron Doctor');
15
- //$this->_addButtonLabel = Mage::helper('zero1_crondoctor')->__('test');
16
  parent::_construct();
17
  }
18
  }
4
  public function __construct()
5
  {
6
  parent::__construct();
7
+
8
  $this->_removeButton('add');
9
  }
10
 
13
  $this->_controller = 'adminhtml_crondoctor';
14
  $this->_blockGroup = 'zero1_crondoctor';
15
  $this->_headerText = Mage::helper('zero1_crondoctor')->__('Cron Doctor');
16
+
17
  parent::_construct();
18
  }
19
  }
app/code/community/Zero1/Crondoctor/Block/Adminhtml/Crondoctor/Grid.php CHANGED
@@ -11,7 +11,6 @@ class Zero1_Crondoctor_Block_Adminhtml_Crondoctor_Grid extends Mage_Adminhtml_Bl
11
  $this->setId('crondoctor');
12
  $this->setDefaultSort('created_at');
13
  $this->setDefaultDir('DESC');
14
- //$this->setUseAjax(true);
15
  }
16
 
17
  /**
@@ -22,8 +21,8 @@ class Zero1_Crondoctor_Block_Adminhtml_Crondoctor_Grid extends Mage_Adminhtml_Bl
22
  protected function _prepareCollection()
23
  {
24
  $collection = Mage::getModel('cron/schedule')->getCollection();
25
-
26
  $this->setCollection($collection);
 
27
  return parent::_prepareCollection();
28
  }
29
 
@@ -36,28 +35,29 @@ class Zero1_Crondoctor_Block_Adminhtml_Crondoctor_Grid extends Mage_Adminhtml_Bl
36
  {
37
  $this->addColumn('schedule_id', array(
38
  'header' => Mage::helper('zero1_crondoctor')->__('ID'),
39
- 'width' => '50px',
40
- 'type' => 'number',
41
- 'index' => 'schedule_id'
42
  ));
43
 
44
  $job_code_options = array();
45
  $job_code_collection = Mage::getModel('cron/schedule')->getCollection();
46
  $job_code_collection->getSelect()->group('job_code');
47
- foreach($job_code_collection as $job_code)
48
  $job_code_options[$job_code->getJobCode()] = ucwords(str_replace('_', ' ', $job_code->getJobCode()));
49
-
 
50
  $this->addColumn('job_code', array(
51
  'header' => Mage::helper('zero1_crondoctor')->__('Job Code'),
52
- 'index' => 'job_code',
53
- 'type' => 'options',
54
  'options' => $job_code_options
55
  ));
56
 
57
  $this->addColumn('status', array(
58
  'header' => Mage::helper('zero1_crondoctor')->__('Status'),
59
- 'index' => 'status',
60
- 'type' => 'options',
61
  'options' => array(
62
  Mage_Cron_Model_Schedule::STATUS_PENDING => Mage::helper('zero1_crondoctor')->__('Pending'),
63
  Mage_Cron_Model_Schedule::STATUS_RUNNING => Mage::helper('zero1_crondoctor')->__('Running'),
@@ -69,48 +69,45 @@ class Zero1_Crondoctor_Block_Adminhtml_Crondoctor_Grid extends Mage_Adminhtml_Bl
69
 
70
  $this->addColumn('messages', array(
71
  'header' => Mage::helper('zero1_crondoctor')->__('Messages'),
72
- 'index' => 'messages'
73
  ));
74
 
75
  $this->addColumn('created_at', array(
76
  'header' => Mage::helper('zero1_crondoctor')->__('Created At'),
77
- 'type' => 'datetime',
78
- 'index' => 'created_at'
79
  ));
80
 
81
  $this->addColumn('scheduled_at', array(
82
  'header' => Mage::helper('zero1_crondoctor')->__('Scheduled At'),
83
- 'type' => 'datetime',
84
- 'index' => 'scheduled_at'
85
  ));
86
 
87
  $this->addColumn('executed_at', array(
88
  'header' => Mage::helper('zero1_crondoctor')->__('Executed At'),
89
- 'type' => 'datetime',
90
- 'index' => 'executed_at'
91
  ));
92
 
93
  $this->addColumn('finished_at', array(
94
  'header' => Mage::helper('zero1_crondoctor')->__('Finished At'),
95
- 'type' => 'datetime',
96
- 'index' => 'finished_at'
 
 
 
 
 
 
97
  ));
98
 
99
  return parent::_prepareColumns();
100
  }
101
 
102
- /**
103
- * Retrieve row url
104
- *
105
- * @return string
106
- */
107
  public function getRowUrl($row)
108
  {
109
- return null;
110
-
111
- return $this->getUrl('*/*/edit', array(
112
- 'id' => $row->getId()
113
- ));
114
  }
115
 
116
  protected function _prepareMassaction()
@@ -120,22 +117,22 @@ class Zero1_Crondoctor_Block_Adminhtml_Crondoctor_Grid extends Mage_Adminhtml_Bl
120
  $this->setNoFilterMassactionColumn(true);
121
 
122
  $this->getMassactionBlock()->addItem('delete', array(
123
- 'label' => $this->__('Delete'),
124
- 'url' => $this->getUrl('*/*/massDelete', array('_current' => true)),
125
- 'confirm' => $this->__('Are you sure?')
126
  ));
127
 
128
  $this->getMassactionBlock()->addItem('change_status', array(
129
- 'label' => $this->__('Change Status'),
130
- 'url' => $this->getUrl('*/*/massChange', array('_current' => true)),
131
- 'confirm' => $this->__('Are you sure?'),
132
- 'additional' => array(
133
- 'mode' => array(
134
- 'name' => 'status',
135
- 'type' => 'select',
136
- 'class' => 'required-entry',
137
- 'label' => Mage::helper('index')->__('Status'),
138
- 'values' => array(
139
  Mage_Cron_Model_Schedule::STATUS_PENDING => Mage::helper('zero1_crondoctor')->__('Pending'),
140
  Mage_Cron_Model_Schedule::STATUS_RUNNING => Mage::helper('zero1_crondoctor')->__('Running'),
141
  Mage_Cron_Model_Schedule::STATUS_SUCCESS => Mage::helper('zero1_crondoctor')->__('Success'),
11
  $this->setId('crondoctor');
12
  $this->setDefaultSort('created_at');
13
  $this->setDefaultDir('DESC');
 
14
  }
15
 
16
  /**
21
  protected function _prepareCollection()
22
  {
23
  $collection = Mage::getModel('cron/schedule')->getCollection();
 
24
  $this->setCollection($collection);
25
+
26
  return parent::_prepareCollection();
27
  }
28
 
35
  {
36
  $this->addColumn('schedule_id', array(
37
  'header' => Mage::helper('zero1_crondoctor')->__('ID'),
38
+ 'width' => '50px',
39
+ 'type' => 'number',
40
+ 'index' => 'schedule_id'
41
  ));
42
 
43
  $job_code_options = array();
44
  $job_code_collection = Mage::getModel('cron/schedule')->getCollection();
45
  $job_code_collection->getSelect()->group('job_code');
46
+ foreach($job_code_collection as $job_code) {
47
  $job_code_options[$job_code->getJobCode()] = ucwords(str_replace('_', ' ', $job_code->getJobCode()));
48
+ }
49
+
50
  $this->addColumn('job_code', array(
51
  'header' => Mage::helper('zero1_crondoctor')->__('Job Code'),
52
+ 'index' => 'job_code',
53
+ 'type' => 'options',
54
  'options' => $job_code_options
55
  ));
56
 
57
  $this->addColumn('status', array(
58
  'header' => Mage::helper('zero1_crondoctor')->__('Status'),
59
+ 'index' => 'status',
60
+ 'type' => 'options',
61
  'options' => array(
62
  Mage_Cron_Model_Schedule::STATUS_PENDING => Mage::helper('zero1_crondoctor')->__('Pending'),
63
  Mage_Cron_Model_Schedule::STATUS_RUNNING => Mage::helper('zero1_crondoctor')->__('Running'),
69
 
70
  $this->addColumn('messages', array(
71
  'header' => Mage::helper('zero1_crondoctor')->__('Messages'),
72
+ 'index' => 'messages'
73
  ));
74
 
75
  $this->addColumn('created_at', array(
76
  'header' => Mage::helper('zero1_crondoctor')->__('Created At'),
77
+ 'type' => 'datetime',
78
+ 'index' => 'created_at'
79
  ));
80
 
81
  $this->addColumn('scheduled_at', array(
82
  'header' => Mage::helper('zero1_crondoctor')->__('Scheduled At'),
83
+ 'type' => 'datetime',
84
+ 'index' => 'scheduled_at'
85
  ));
86
 
87
  $this->addColumn('executed_at', array(
88
  'header' => Mage::helper('zero1_crondoctor')->__('Executed At'),
89
+ 'type' => 'datetime',
90
+ 'index' => 'executed_at'
91
  ));
92
 
93
  $this->addColumn('finished_at', array(
94
  'header' => Mage::helper('zero1_crondoctor')->__('Finished At'),
95
+ 'type' => 'datetime',
96
+ 'index' => 'finished_at'
97
+ ));
98
+
99
+ $this->addColumn('reported_at', array(
100
+ 'header' => Mage::helper('zero1_crondoctor')->__('Reported At'),
101
+ 'type' => 'datetime',
102
+ 'index' => 'reported_at'
103
  ));
104
 
105
  return parent::_prepareColumns();
106
  }
107
 
 
 
 
 
 
108
  public function getRowUrl($row)
109
  {
110
+ return null;
 
 
 
 
111
  }
112
 
113
  protected function _prepareMassaction()
117
  $this->setNoFilterMassactionColumn(true);
118
 
119
  $this->getMassactionBlock()->addItem('delete', array(
120
+ 'label' => $this->__('Delete'),
121
+ 'url' => $this->getUrl('*/*/massDelete', array('_current' => true)),
122
+ 'confirm' => $this->__('Are you sure?')
123
  ));
124
 
125
  $this->getMassactionBlock()->addItem('change_status', array(
126
+ 'label' => $this->__('Change Status'),
127
+ 'url' => $this->getUrl('*/*/massChange', array('_current' => true)),
128
+ 'confirm' => $this->__('Are you sure?'),
129
+ 'additional' => array(
130
+ 'mode' => array(
131
+ 'name' => 'status',
132
+ 'type' => 'select',
133
+ 'class' => 'required-entry',
134
+ 'label' => Mage::helper('index')->__('Status'),
135
+ 'values' => array(
136
  Mage_Cron_Model_Schedule::STATUS_PENDING => Mage::helper('zero1_crondoctor')->__('Pending'),
137
  Mage_Cron_Model_Schedule::STATUS_RUNNING => Mage::helper('zero1_crondoctor')->__('Running'),
138
  Mage_Cron_Model_Schedule::STATUS_SUCCESS => Mage::helper('zero1_crondoctor')->__('Success'),
app/code/community/Zero1/Crondoctor/Block/Adminhtml/Crondoctor/Notice.php CHANGED
@@ -8,11 +8,12 @@ class Zero1_Crondoctor_Block_Adminhtml_Crondoctor_Notice extends Mage_Adminhtml_
8
  $this->_errors = array();
9
 
10
  $cronjob_collection = Mage::getModel('cron/schedule')->getCollection();
11
- $cronjob_collection->addFieldToFilter('status', array('eq' => Mage_Cron_Model_Schedule::STATUS_ERROR));
 
 
12
  $cronjob_collection->getSelect()->group('job_code');
13
 
14
- foreach($cronjob_collection as $cronjob)
15
- {
16
  $this->_errors[] = ucwords(str_replace('_', ' ', $cronjob->getJobCode()));
17
  }
18
 
8
  $this->_errors = array();
9
 
10
  $cronjob_collection = Mage::getModel('cron/schedule')->getCollection();
11
+ $cronjob_collection->addFieldToFilter('status', array(
12
+ 'eq' => Mage_Cron_Model_Schedule::STATUS_ERROR)
13
+ );
14
  $cronjob_collection->getSelect()->group('job_code');
15
 
16
+ foreach($cronjob_collection as $cronjob) {
 
17
  $this->_errors[] = ucwords(str_replace('_', ' ', $cronjob->getJobCode()));
18
  }
19
 
app/code/community/Zero1/Crondoctor/Model/Observer.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Zero1_Crondoctor_Model_Observer
3
+ {
4
+ const XML_PATH_ZOMBIE_EMAIL_TEMPLATE = 'zero1_crondoctor/settings/zombie_email_template';
5
+ const XML_PATH_ZOMBIE_EMAIL_TO = 'zero1_crondoctor/settings/zombie_email';
6
+ const XML_PATH_ZOMBIE_TIME = 'zero1_crondoctor/settings/zombie_time';
7
+
8
+ protected $_zombieEmailSubject = 'Magento Cron Doctor Zombie Report';
9
+
10
+ public function checkForZombieJobs(Varien_Event_Observer $observer)
11
+ {
12
+ $storeId = Mage::app()->getStore()->getId();
13
+ $to = Mage::getStoreConfig(self::XML_PATH_ZOMBIE_EMAIL_TO, $storeId);
14
+
15
+ if(!$to) {
16
+ return; // No destination address.
17
+ }
18
+
19
+ $cronjob_collection = Mage::getModel('cron/schedule')->getCollection();
20
+ $cronjob_collection->addFieldToFilter('status', array(
21
+ 'eq' => Mage_Cron_Model_Schedule::STATUS_RUNNING)
22
+ );
23
+
24
+ $job_list_content = '';
25
+ foreach($cronjob_collection as $cronjob) {
26
+ if($cronjob->getReportedAt()) {
27
+ continue; // No need to report more then once.
28
+ }
29
+
30
+ $running_time = ceil((time() - strtotime($cronjob->getExecutedAt())) / 60);
31
+
32
+ if($running_time >= Mage::getStoreConfig(self::XML_PATH_ZOMBIE_TIME, $storeId)) {
33
+ $job_list_content .= '"'.ucwords(str_replace('_', ' ', $cronjob->getJobCode()))."'";
34
+ $job_list_content .= ' has been running for '.$running_time.' minutes.<br/>';
35
+
36
+ $cronjob->setReportedAt(strftime('%Y-%m-%d %H:%M:%S', time()));
37
+ $cronjob->save();
38
+ }
39
+ }
40
+
41
+ if($job_list_content != '') {
42
+ $translate = Mage::getSingleton('core/translate');
43
+ $translate->setTranslateInline(false);
44
+
45
+ Mage::getModel('core/email_template')
46
+ ->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))
47
+ ->sendTransactional(
48
+ Mage::getStoreConfig(self::XML_PATH_ZOMBIE_EMAIL_TEMPLATE, $storeId),
49
+ Mage::getStoreConfig(Mage_Sales_Model_Order::XML_PATH_EMAIL_IDENTITY, $storeId),
50
+ $to,
51
+ null,
52
+ array(
53
+ 'subject' => $this->_zombieEmailSubject,
54
+ 'job_list_content' => $job_list_content,
55
+ )
56
+ );
57
+
58
+ $translate->setTranslateInline(true);
59
+ }
60
+ }
61
+ }
app/code/community/Zero1/Crondoctor/Model/Resource/Setup.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
- class Zero1_Crondoctor_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
3
- {
4
- }
 
 
 
 
app/code/community/Zero1/Crondoctor/controllers/Adminhtml/CrondoctorController.php CHANGED
@@ -3,10 +3,9 @@ class Zero1_Crondoctor_Adminhtml_CrondoctorController extends Mage_Adminhtml_Con
3
  {
4
  protected function _initAction()
5
  {
6
- $this->loadLayout()
7
- ->_setActiveMenu('system/zero1_crondoctor');
8
-
9
- $this->_title(Mage::helper('zero1_crondoctor')->__('System'))->_title(Mage::helper('zero1_crondoctor')->__('Cron Doctor'));
10
  return $this;
11
  }
12
 
@@ -36,12 +35,6 @@ class Zero1_Crondoctor_Adminhtml_CrondoctorController extends Mage_Adminhtml_Con
36
  } else {
37
  $this->_getSession()->addError($this->__('No jobs were deleted.'));
38
  }
39
- } catch (Zend_Gdata_App_CaptchaRequiredException $e) {
40
- $this->_getSession()->addError($e->getMessage());
41
- $this->_redirectToCaptcha($e);
42
- return;
43
- } catch (Zend_Gdata_App_Exception $e) {
44
- $this->_getSession()->addError($this->_parseGdataExceptionMessage($e->getMessage()));
45
  } catch (Exception $e) {
46
  $this->_getSession()->addError($e->getMessage());
47
  }
@@ -71,12 +64,6 @@ class Zero1_Crondoctor_Adminhtml_CrondoctorController extends Mage_Adminhtml_Con
71
  } else {
72
  $this->_getSession()->addError($this->__('No jobs were updated.'));
73
  }
74
- } catch (Zend_Gdata_App_CaptchaRequiredException $e) {
75
- $this->_getSession()->addError($e->getMessage());
76
- $this->_redirectToCaptcha($e);
77
- return;
78
- } catch (Zend_Gdata_App_Exception $e) {
79
- $this->_getSession()->addError($this->_parseGdataExceptionMessage($e->getMessage()));
80
  } catch (Exception $e) {
81
  $this->_getSession()->addError($e->getMessage());
82
  }
3
  {
4
  protected function _initAction()
5
  {
6
+ $this->loadLayout()->_setActiveMenu('system/zero1_crondoctor');
7
+ $this->_title(Mage::helper('zero1_crondoctor')->__('Cron Doctor'));
8
+
 
9
  return $this;
10
  }
11
 
35
  } else {
36
  $this->_getSession()->addError($this->__('No jobs were deleted.'));
37
  }
 
 
 
 
 
 
38
  } catch (Exception $e) {
39
  $this->_getSession()->addError($e->getMessage());
40
  }
64
  } else {
65
  $this->_getSession()->addError($this->__('No jobs were updated.'));
66
  }
 
 
 
 
 
 
67
  } catch (Exception $e) {
68
  $this->_getSession()->addError($e->getMessage());
69
  }
app/code/community/Zero1/Crondoctor/etc/adminhtml.xml CHANGED
@@ -20,6 +20,14 @@
20
  <title>Cron Doctor</title>
21
  <sort_order>99</sort_order>
22
  </zero1_crondoctor>
 
 
 
 
 
 
 
 
23
  </children>
24
  </system>
25
  </children>
20
  <title>Cron Doctor</title>
21
  <sort_order>99</sort_order>
22
  </zero1_crondoctor>
23
+
24
+ <config>
25
+ <children>
26
+ <zero1_crondoctor translate="title" module="zero1_crondoctor">
27
+ <title>Cron Doctor Section</title>
28
+ </zero1_crondoctor>
29
+ </children>
30
+ </config>
31
  </children>
32
  </system>
33
  </children>
app/code/community/Zero1/Crondoctor/etc/config.xml CHANGED
@@ -1,50 +1,49 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <config>
3
  <modules>
4
  <Zero1_Crondoctor>
5
- <version>1.0.1.0</version>
6
  </Zero1_Crondoctor>
7
  </modules>
8
-
9
- <global>
10
  <blocks>
11
  <zero1_crondoctor>
12
  <class>Zero1_Crondoctor_Block</class>
13
  </zero1_crondoctor>
14
  </blocks>
15
-
16
  <helpers>
17
  <zero1_crondoctor>
18
  <class>Zero1_Crondoctor_Helper</class>
19
  </zero1_crondoctor>
20
  </helpers>
21
-
22
- <models>
23
  <zero1_crondoctor>
24
  <class>Zero1_Crondoctor_Model</class>
25
- <resourceModel>zero1_crondoctor_resource</resourceModel>
26
  </zero1_crondoctor>
27
-
28
- <zero1_crondoctor_resource>
29
- <class>Zero1_Crondoctor_Model_Resource</class>
30
- <entities>
31
- <crondoctor>
32
- <table>zero1_crondoctor</table>
33
- </crondoctor>
34
- </entities>
35
- </zero1_crondoctor_resource>
36
  </models>
37
-
38
  <resources>
39
  <zero1_crondoctor_setup>
40
  <setup>
41
  <module>Zero1_Crondoctor</module>
42
- <class>Zero1_Crondoctor_Model_Resource_Setup</class>
43
  </setup>
44
  </zero1_crondoctor_setup>
45
  </resources>
 
 
 
 
 
 
 
 
 
 
46
  </global>
47
-
48
  <admin>
49
  <routers>
50
  <adminhtml>
@@ -56,17 +55,7 @@
56
  </adminhtml>
57
  </routers>
58
  </admin>
59
-
60
- <frontend>
61
- <layout>
62
- <updates>
63
- <zero1_crondoctor>
64
- <file>crondoctor/crondoctor.xml</file>
65
- </zero1_crondoctor>
66
- </updates>
67
- </layout>
68
- </frontend>
69
-
70
  <adminhtml>
71
  <layout>
72
  <updates>
@@ -76,14 +65,27 @@
76
  </updates>
77
  </layout>
78
  </adminhtml>
79
-
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  <default>
81
  <zero1_crondoctor>
82
- <options>
83
- <enabled>1</enabled>
84
- </options>
 
 
85
  </zero1_crondoctor>
86
  </default>
87
-
88
-
89
  </config>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
  <modules>
4
  <Zero1_Crondoctor>
5
+ <version>1.0.0</version>
6
  </Zero1_Crondoctor>
7
  </modules>
8
+
9
+ <global>
10
  <blocks>
11
  <zero1_crondoctor>
12
  <class>Zero1_Crondoctor_Block</class>
13
  </zero1_crondoctor>
14
  </blocks>
15
+
16
  <helpers>
17
  <zero1_crondoctor>
18
  <class>Zero1_Crondoctor_Helper</class>
19
  </zero1_crondoctor>
20
  </helpers>
21
+
22
+ <models>
23
  <zero1_crondoctor>
24
  <class>Zero1_Crondoctor_Model</class>
 
25
  </zero1_crondoctor>
 
 
 
 
 
 
 
 
 
26
  </models>
27
+
28
  <resources>
29
  <zero1_crondoctor_setup>
30
  <setup>
31
  <module>Zero1_Crondoctor</module>
 
32
  </setup>
33
  </zero1_crondoctor_setup>
34
  </resources>
35
+
36
+ <template>
37
+ <email>
38
+ <zero1_crondoctor_settings_zombie_email_template translate="label" module="zero1_crondoctor">
39
+ <label>Cron Doctor zombie email</label>
40
+ <file>crondoctor_zombieemail.html</file>
41
+ <type>html</type>
42
+ </zero1_crondoctor_settings_zombie_email_template>
43
+ </email>
44
+ </template>
45
  </global>
46
+
47
  <admin>
48
  <routers>
49
  <adminhtml>
55
  </adminhtml>
56
  </routers>
57
  </admin>
58
+
 
 
 
 
 
 
 
 
 
 
59
  <adminhtml>
60
  <layout>
61
  <updates>
65
  </updates>
66
  </layout>
67
  </adminhtml>
68
+
69
+ <crontab>
70
+ <jobs>
71
+ <zero1_crondoctor_zombie_check>
72
+ <schedule>
73
+ <cron_expr>* * * * *</cron_expr>
74
+ </schedule>
75
+ <run>
76
+ <model>zero1_crondoctor/observer::checkForZombieJobs</model>
77
+ </run>
78
+ </zero1_crondoctor_zombie_check>
79
+ </jobs>
80
+ </crontab>
81
+
82
  <default>
83
  <zero1_crondoctor>
84
+ <settings>
85
+ <zombie_email_template>zero1_crondoctor_settings_zombie_email_template</zombie_email_template>
86
+ <zombie_email></zombie_email>
87
+ <zombie_time>5</zombie_time>
88
+ </settings>
89
  </zero1_crondoctor>
90
  </default>
 
 
91
  </config>
app/code/community/Zero1/Crondoctor/etc/system.xml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <zero1_crondoctor translate="label" module="zero1_crondoctor">
5
+ <label>Cron Doctor</label>
6
+ <tab>advanced</tab>
7
+ <frontend_type>text</frontend_type>
8
+ <sort_order>990</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>1</show_in_store>
12
+ <groups>
13
+ <settings translate="label">
14
+ <label>Cron Doctor Zombie Monitoring</label>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>1</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <fields>
21
+ <zombie_email_template translate="label">
22
+ <label>Alert email template</label>
23
+ <frontend_type>select</frontend_type>
24
+ <source_model>adminhtml/system_config_source_email_template</source_model>
25
+ <sort_order>1</sort_order>
26
+ <show_in_default>1</show_in_default>
27
+ <show_in_website>1</show_in_website>
28
+ <show_in_store>1</show_in_store>
29
+ </zombie_email_template>
30
+
31
+ <zombie_email translate="label comment">
32
+ <label>Alert email destination(s)</label>
33
+ <comment><![CDATA[Email addresses separated by commas.]]></comment>
34
+ <frontend_type>text</frontend_type>
35
+ <sort_order>2</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ </zombie_email>
40
+
41
+ <zombie_time translate="label comment">
42
+ <label>Minutes before flagging job as Zombie</label>
43
+ <comment><![CDATA[If a job has been running for X minutes report it as a zombie.]]></comment>
44
+ <frontend_type>text</frontend_type>
45
+ <sort_order>3</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>1</show_in_store>
49
+ </zombie_time>
50
+ </fields>
51
+ </settings>
52
+ </groups>
53
+ </zero1_crondoctor>
54
+ </sections>
55
+ </config>
app/code/community/Zero1/Crondoctor/sql/zero1_crondoctor_setup/install-1.0.0.0.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
- $installer = $this;
3
- $installer->startSetup();
4
-
5
- $installer->endSetup();
 
 
 
 
 
app/code/community/Zero1/Crondoctor/sql/zero1_crondoctor_setup/install-1.0.0.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $installer Mage_Core_Model_Resource_Setup */
3
+ $installer = $this;
4
+ $installer->startSetup();
5
+
6
+ /**
7
+ * Change columns
8
+ */
9
+ $installer->getConnection()->addColumn(
10
+ $installer->getTable('cron/schedule'),
11
+ 'reported_at',
12
+ array(
13
+ 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
14
+ 'nullable' => true,
15
+ 'comment' => 'Reported At'
16
+ )
17
+ );
18
+
19
+ $installer->endSetup();
app/code/community/Zero1/Crondoctor/sql/zero1_crondoctor_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $installer Mage_Core_Model_Resource_Setup */
3
+ $installer = $this;
4
+ $installer->startSetup();
5
+
6
+ /**
7
+ * Change columns
8
+ */
9
+ $installer->getConnection()->addColumn(
10
+ $installer->getTable('cron/schedule'),
11
+ 'reported_at',
12
+ array(
13
+ 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
14
+ 'nullable' => true,
15
+ 'comment' => 'Reported At'
16
+ )
17
+ );
18
+
19
+ $installer->endSetup();
app/locale/en_US/template/email/crondoctor_zombieemail.html ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <!--@subject {{var subject}} @-->
2
+ {{var job_list_content}}
3
+
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Zero1_Crondoctor</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://shop.zero1.co.uk/LICENSE.txt">Commercial</license>
7
  <channel>community</channel>
@@ -9,11 +9,11 @@
9
  <summary>Crondoctor</summary>
10
  <description>Crondoctor&#xD;
11
  </description>
12
- <notes>Version update for Magento Connect issue.</notes>
13
  <authors><author><name>Arron Moss</name><user>zero1limited</user><email>arron.moss@zero1.co.uk</email></author></authors>
14
- <date>2013-03-08</date>
15
- <time>14:48:35</time>
16
- <contents><target name="magecommunity"><dir name="Zero1"><dir name="Crondoctor"><dir name="Block"><dir name="Adminhtml"><dir name="Crondoctor"><file name="Grid.php" hash="e5dfc21a355aa1897b64a511bf2f787c"/><file name="Notice.php" hash="cb902ffee94b02dad0689fed02f1ca20"/></dir><file name="Crondoctor.php" hash="8cf6330d654400039ba4f6cbf4f72f81"/></dir></dir><dir name="Helper"><file name="Data.php" hash="4b85072f6909ba3f083c99814103a92a"/></dir><dir name="Model"><dir name="Resource"><file name="Setup.php" hash="eb67fad34e6d1239679a0c547c44ec85"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CrondoctorController.php" hash="8a849b91ba3814b33d7e2e693c217524"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="774e8bf1d0181f8dc74855c1d74bd692"/><file name="config.xml" hash="2e720ba743b7d5d988d1593c306ba40b"/></dir><dir name="sql"><dir name="zero1_crondoctor_setup"><file name="install-1.0.0.0.php" hash="b68f44efb7ec07f29aa5b2449ec0ca87"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Zero1_Crondoctor.xml" hash="3ccefc4ae6efeecc2bfd7df6a59264f1"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="crondoctor"><file name="crondoctor.xml" hash="61e541ccd7156e8e7dad6197792b4315"/></dir></dir><dir name="template"><dir name="crondoctor"><file name="notice.phtml" hash="95575d8f09e623c05c0de950677346ce"/></dir></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Zero1_Crondoctor</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://shop.zero1.co.uk/LICENSE.txt">Commercial</license>
7
  <channel>community</channel>
9
  <summary>Crondoctor</summary>
10
  <description>Crondoctor&#xD;
11
  </description>
12
+ <notes>Adding Zombie support</notes>
13
  <authors><author><name>Arron Moss</name><user>zero1limited</user><email>arron.moss@zero1.co.uk</email></author></authors>
14
+ <date>2013-04-23</date>
15
+ <time>15:15:28</time>
16
+ <contents><target name="magecommunity"><dir name="Zero1"><dir name="Crondoctor"><dir name="Block"><dir name="Adminhtml"><dir name="Crondoctor"><file name="Grid.php" hash="ff758796ef8d66b388e0b1d60d73f92e"/><file name="Notice.php" hash="6b4c20f69f875fa3410a34acc8d2209a"/></dir><file name="Crondoctor.php" hash="6fa8fd6eee1dd35d9b82f861238738c1"/></dir></dir><dir name="Helper"><file name="Data.php" hash="4b85072f6909ba3f083c99814103a92a"/></dir><dir name="Model"><file name="Observer.php" hash="dfd50076e1bfdcf07271be735259b03b"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CrondoctorController.php" hash="209983731264467ce1c2d3d7989039ac"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="56bcc9e463c033655658d711e3549636"/><file name="config.xml" hash="d7704706605fd5b48d589b68d64d63dc"/><file name="system.xml" hash="13b054b6902fd74eacdcdec95dc054de"/></dir><dir name="sql"><dir name="zero1_crondoctor_setup"><file name="install-1.0.0.php" hash="af6b55e68b5c327efcf58452719d359e"/><file name="mysql4-install-1.0.0.php" hash="af6b55e68b5c327efcf58452719d359e"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Zero1_Crondoctor.xml" hash="3ccefc4ae6efeecc2bfd7df6a59264f1"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="crondoctor"><file name="crondoctor.xml" hash="61e541ccd7156e8e7dad6197792b4315"/></dir></dir><dir name="template"><dir name="crondoctor"><file name="notice.phtml" hash="95575d8f09e623c05c0de950677346ce"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="crondoctor_zombieemail.html" hash="dbb8893fbb2820d9959a6aee56e05722"/></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>