Jowens_JobQueue - Version 0.3.0

Version Notes

Fixed issue executing queued jobs.

Download this release

Release Info

Developer Jordan Owens
Extension Jowens_JobQueue
Version 0.3.0
Comparing to
See all releases


Code changes from version 0.2.0 to 0.3.0

app/code/community/Jowens/JobQueue/Block/Adminhtml/Job/View.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class Jowens_JobQueue_Block_Adminhtml_Job_View extends Mage_Adminhtml_Block_Widget_Form_Container
4
  {
5
 
6
  protected $_job;
@@ -71,4 +71,4 @@ class Jowens_JobQueue_Block_Adminhtml_Job_View extends Mage_Adminhtml_Block_Widg
71
  $this->setCreatedAtHtml($this->escapeHtml($createdAt));
72
  return parent::_toHtml();
73
  }
74
- }
1
  <?php
2
 
3
+ class Jowens_JobQueue_Block_Adminhtml_Job_View extends Mage_Adminhtml_Block_Widget_Container
4
  {
5
 
6
  protected $_job;
71
  $this->setCreatedAtHtml($this->escapeHtml($createdAt));
72
  return parent::_toHtml();
73
  }
74
+ }
app/code/community/Jowens/JobQueue/Model/.DS_Store ADDED
Binary file
app/code/community/Jowens/JobQueue/Model/Worker.php CHANGED
@@ -14,7 +14,10 @@ class Jowens_JobQueue_Model_Worker extends Mage_Core_Model_Abstract
14
  public function __construct() {
15
  list($hostname, $pid) = array(trim(`hostname`), getmypid());
16
  $this->workerName = "host::$hostname pid::$pid";
17
- $this->queue = Mage::getStoreConfig('jobqueue/config/queue', self::DEFAULT_QUEUE);
 
 
 
18
  }
19
 
20
  public function getQueue() {
@@ -92,4 +95,4 @@ class Jowens_JobQueue_Model_Worker extends Mage_Core_Model_Abstract
92
  array('mysql_user' => $config->username, 'mysql_pass' => $config->password)
93
  );
94
  }
95
- }
14
  public function __construct() {
15
  list($hostname, $pid) = array(trim(`hostname`), getmypid());
16
  $this->workerName = "host::$hostname pid::$pid";
17
+ $this->queue = Mage::getStoreConfig('jobqueue/config/queue');
18
+ if(empty($this->queue)) {
19
+ $this->queue = self::DEFAULT_QUEUE;
20
+ }
21
  }
22
 
23
  public function getQueue() {
95
  array('mysql_user' => $config->username, 'mysql_pass' => $config->password)
96
  );
97
  }
98
+ }
app/code/community/Jowens/JobQueue/controllers/Adminhtml/QueueController.php CHANGED
@@ -210,4 +210,4 @@ class Jowens_JobQueue_Adminhtml_QueueController extends Mage_Adminhtml_Controlle
210
 
211
  $this->_redirect('*/*/index');
212
  }
213
- }
210
 
211
  $this->_redirect('*/*/index');
212
  }
213
+ }
app/code/community/Jowens/JobQueue/etc/system.xml CHANGED
@@ -13,12 +13,16 @@
13
  <frontend_type>text</frontend_type>
14
  <sort_order>2</sort_order>
15
  <show_in_default>1</show_in_default>
 
 
16
  <fields>
17
  <enabled translate="label comment">
18
  <label>Cron Worker Enabled</label>
19
  <frontend_type>select</frontend_type>
20
  <source_model>adminhtml/system_config_source_yesno</source_model>
21
  <show_in_default>1</show_in_default>
 
 
22
  </enabled>
23
  <cron_expr>
24
  <label>How often do you want the cron to run?</label>
@@ -26,22 +30,28 @@
26
  <sort_order>40</sort_order>
27
  <comment>Use Crontab Format (Eg. "*/5 * * * *" for every 5 minutes)</comment>
28
  <show_in_default>1</show_in_default>
 
 
29
  </cron_expr>
30
  <max_attempts>
31
  <label>Max Attempts</label>
32
  <frontend_type>text</frontend_type>
33
  <sort_order>50</sort_order>
34
  <show_in_default>1</show_in_default>
 
 
35
  </max_attempts>
36
  <queue>
37
  <label>Queue</label>
38
  <frontend_type>text</frontend_type>
39
  <sort_order>60</sort_order>
40
  <show_in_default>1</show_in_default>
 
 
41
  </queue>
42
  </fields>
43
  </config>
44
  </groups>
45
  </jobqueue>
46
  </sections>
47
- </config>
13
  <frontend_type>text</frontend_type>
14
  <sort_order>2</sort_order>
15
  <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
  <fields>
19
  <enabled translate="label comment">
20
  <label>Cron Worker Enabled</label>
21
  <frontend_type>select</frontend_type>
22
  <source_model>adminhtml/system_config_source_yesno</source_model>
23
  <show_in_default>1</show_in_default>
24
+ <show_in_website>0</show_in_website>
25
+ <show_in_store>0</show_in_store>
26
  </enabled>
27
  <cron_expr>
28
  <label>How often do you want the cron to run?</label>
30
  <sort_order>40</sort_order>
31
  <comment>Use Crontab Format (Eg. "*/5 * * * *" for every 5 minutes)</comment>
32
  <show_in_default>1</show_in_default>
33
+ <show_in_website>0</show_in_website>
34
+ <show_in_store>0</show_in_store>
35
  </cron_expr>
36
  <max_attempts>
37
  <label>Max Attempts</label>
38
  <frontend_type>text</frontend_type>
39
  <sort_order>50</sort_order>
40
  <show_in_default>1</show_in_default>
41
+ <show_in_website>0</show_in_website>
42
+ <show_in_store>0</show_in_store>
43
  </max_attempts>
44
  <queue>
45
  <label>Queue</label>
46
  <frontend_type>text</frontend_type>
47
  <sort_order>60</sort_order>
48
  <show_in_default>1</show_in_default>
49
+ <show_in_website>0</show_in_website>
50
+ <show_in_store>0</show_in_store>
51
  </queue>
52
  </fields>
53
  </config>
54
  </groups>
55
  </jobqueue>
56
  </sections>
57
+ </config>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Jowens_JobQueue</name>
4
- <version>0.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">MIT</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Asynchronous job queue for Magento</summary>
10
  <description>JobQueue allows jobs to be queued in the database to be processed asynchronously.</description>
11
- <notes>Fixed issue connecting to database using Unix sockets. Add option to execute job immediately and queue on failure.</notes>
12
  <authors><author><name>Jordan Owens</name><user>jkowens</user><email>jkowens@gmail.com</email></author></authors>
13
  <date>2014-01-07</date>
14
- <time>19:38:00</time>
15
- <contents><target name="magecommunity"><dir name="Jowens"><dir name="JobQueue"><dir name="Block"><dir name="Adminhtml"><dir name="Job"><file name="View.php" hash="c8fbae78ea626fa7273947245e77be3d"/></dir><dir name="Queue"><file name="Grid.php" hash="9618ecc67272f750c88e7e19680aaa44"/></dir><file name="Queue.php" hash="719a95c4bde9c4c109b159d0667de2da"/></dir></dir><dir name="Helper"><file name="Data.php" hash="8c8b3a2b79a1546e8b6600dde974c049"/></dir><dir name="Model"><dir name="Job"><file name="Abstract.php" hash="464af3c758f6c94fc768f48379bf287e"/></dir><file name="Job.php" hash="f0b9928c1063dc3d90087fb69de16fa4"/><dir name="Resource"><dir name="Job"><file name="Collection.php" hash="a175198f2c3d252dadb817d108920b3f"/></dir><file name="Job.php" hash="30843d577f463d43ed4e3807187e8248"/><file name="Setup.php" hash="911413029124da3964d9822926fb44de"/></dir><file name="Worker.php" hash="dfed14779daf2a060db649ccddd9c810"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="QueueController.php" hash="a05f9d0828a7a18b27c1b966042e415f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="885171a59394683e2a8ec1d5701c0817"/><file name="config.xml" hash="826804a99f7ee2ce96aaabbdc87df3cb"/><file name="system.xml" hash="3a8426d2f3c9a3f29d4adff6733d3ea9"/></dir><dir name="sql"><dir name="jobqueue_setup"><file name="mysql4-install-0.1.0.php" hash="19592c4c921f2e1c64e85c1a776edda2"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Jowens_JobQueue.xml" hash="272f42382ccc1b0226c7e25c078d54ae"/></dir></target><target name="magelib"><dir name="DJJob"><file name="DJJob.php" hash="c2a742d0e2cb43208844636b243ec8ae"/><file name="LICENSE" hash="34cf8e3fef5d267eb53ad593d4e14dd3"/><file name="README.textile" hash="ae3feeccf3476b207a05894aabf4afaf"/><file name="composer.json" hash="101e6cb50439389d03c73b7a5179dc0a"/><dir name="examples"><file name="HelloWorldJob.php" hash="3b7a9e4b1f912fb48acf5399f5fe33b9"/></dir><file name="jobs.sql" hash="d73a8213feedadf9dc9eb719fe33b935"/><dir name="test"><file name="database.php" hash="c130f97354004a05752ec114e9d2c9eb"/></dir><file name=".git" hash="6efe08f8b224dddac89f9229e7ccd042"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="jowens"><file name="jobqueue.xml" hash="491d99d8da67cc879386dda4ef90f285"/></dir></dir><dir name="template"><dir name="jowens"><dir name="jobqueue"><file name="job.phtml" hash="1511cf6f2b85b62f77d6ce741004875e"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0</min><max></max></package></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Jowens_JobQueue</name>
4
+ <version>0.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">MIT</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Asynchronous job queue for Magento</summary>
10
  <description>JobQueue allows jobs to be queued in the database to be processed asynchronously.</description>
11
+ <notes>Fixed issue executing queued jobs.</notes>
12
  <authors><author><name>Jordan Owens</name><user>jkowens</user><email>jkowens@gmail.com</email></author></authors>
13
  <date>2014-01-07</date>
14
+ <time>22:32:42</time>
15
+ <contents><target name="magecommunity"><dir name="Jowens"><dir name="JobQueue"><dir name="Block"><dir name="Adminhtml"><dir name="Job"><file name="View.php" hash="eb45668ba7fcb8e558ad87b7d21b87ac"/></dir><dir name="Queue"><file name="Grid.php" hash="9618ecc67272f750c88e7e19680aaa44"/></dir><file name="Queue.php" hash="719a95c4bde9c4c109b159d0667de2da"/></dir></dir><dir name="Helper"><file name="Data.php" hash="8c8b3a2b79a1546e8b6600dde974c049"/></dir><dir name="Model"><dir name="Job"><file name="Abstract.php" hash="464af3c758f6c94fc768f48379bf287e"/></dir><file name="Job.php" hash="f0b9928c1063dc3d90087fb69de16fa4"/><dir name="Resource"><dir name="Job"><file name="Collection.php" hash="a175198f2c3d252dadb817d108920b3f"/></dir><file name="Job.php" hash="30843d577f463d43ed4e3807187e8248"/><file name="Setup.php" hash="911413029124da3964d9822926fb44de"/></dir><file name="Worker.php" hash="7ca65f4a22f58b85b44d08fe01e2e710"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="QueueController.php" hash="c3134b96774c9d3af9b50835fdd3463a"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="885171a59394683e2a8ec1d5701c0817"/><file name="config.xml" hash="826804a99f7ee2ce96aaabbdc87df3cb"/><file name="system.xml" hash="65f3b71d70492f76097d993053ee4d44"/></dir><dir name="sql"><dir name="jobqueue_setup"><file name="mysql4-install-0.1.0.php" hash="19592c4c921f2e1c64e85c1a776edda2"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Jowens_JobQueue.xml" hash="272f42382ccc1b0226c7e25c078d54ae"/></dir></target><target name="magelib"><dir name="DJJob"><file name="DJJob.php" hash="c2a742d0e2cb43208844636b243ec8ae"/><file name="LICENSE" hash="34cf8e3fef5d267eb53ad593d4e14dd3"/><file name="README.textile" hash="ae3feeccf3476b207a05894aabf4afaf"/><file name="composer.json" hash="101e6cb50439389d03c73b7a5179dc0a"/><dir name="examples"><file name="HelloWorldJob.php" hash="3b7a9e4b1f912fb48acf5399f5fe33b9"/></dir><file name="jobs.sql" hash="d73a8213feedadf9dc9eb719fe33b935"/><dir name="test"><file name="database.php" hash="c130f97354004a05752ec114e9d2c9eb"/></dir><file name=".git" hash="6efe08f8b224dddac89f9229e7ccd042"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="jowens"><file name="jobqueue.xml" hash="491d99d8da67cc879386dda4ef90f285"/></dir></dir><dir name="template"><dir name="jowens"><dir name="jobqueue"><file name="job.phtml" hash="1511cf6f2b85b62f77d6ce741004875e"/></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0</min><max></max></package></required></dependencies>
18
  </package>