Skip to content

Commit

Permalink
Merge pull request #43 from Ethan3600/1.x-develop
Browse files Browse the repository at this point in the history
Upgrade to v1.3.4
  • Loading branch information
Ethan Yehuda authored Apr 19, 2018
2 parents eb17e67 + 58447fa commit 4b7f115
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Manage/Job/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function execute()
$scheduledAt = $this->getRequest()->getParam('scheduled_at');
try {
$this->cronJobManager->createCronJob($jobCode, $scheduledAt);
} catch (\Magento\Framework\Exception\CronException $e) {
} catch (\Exception $e) {
$this->getMessageManager()->addErrorMessage($e->getMessage());
$this->_redirect('*/manage/create/');
return;
Expand Down
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Manage/Job/Dispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function execute()
$jobCode = $this->getRequest()->getParam('job_code');
try {
$this->cronJobManager->dispatchCron($jobId, $jobCode);
} catch (\Magento\Framework\Exception\CronException $e) {
} catch (\Exception $e) {
$this->getMessageManager()->addErrorMessage($e->getMessage());
$this->_redirect('*/manage/index/');
return;
Expand Down
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Manage/Job/Flush.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function execute()
{
try {
$this->cronJobManager->flushCrons();
} catch (\Magento\Framework\Exception\CronException $e) {
} catch (\Exception $e) {
$this->getMessageManager()->addErrorMessage($e->getMessage());
$this->_redirect('*/manage/index/');
return;
Expand Down
11 changes: 6 additions & 5 deletions Helper/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ public function runJob($scheduledTime, $currentTime, $jobConfig, $schedule, $gro
$callback = [$model, $jobConfig['method']];
if (!is_callable($callback)) {
$schedule->setStatus(Schedule::STATUS_ERROR);
throw new \Exception(
sprintf('Invalid callback: %s::%s can\'t be called', $jobConfig['instance'], $jobConfig['method'])
);
throw new \Exception(sprintf('Invalid callback: %s::%s can\'t be called',
$jobConfig['instance'],
$jobConfig['method']
));
}
$schedule->setExecutedAt(strftime('%Y-%m-%d %H:%M:%S', $this->dateTime->gmtTimestamp()))->save();

Expand All @@ -106,7 +107,7 @@ public function runJob($scheduledTime, $currentTime, $jobConfig, $schedule, $gro
} catch (\Throwable $e) {
$schedule->setStatus(Schedule::STATUS_ERROR);
$this->logger->error(sprintf(
'Cron Job %s has an error: %s. Statistics: %s',
'Cron Job %s has an error: %s.',
$jobCode,
$e->getMessage()
));
Expand Down Expand Up @@ -234,4 +235,4 @@ private function getCronGroupConfigurationValue($groupId, $path)
ScopeInterface::SCOPE_STORE
);
}
}
}
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="EthanYehuda_CronjobManager" setup_version="1.3.3" >
<module name="EthanYehuda_CronjobManager" setup_version="1.3.4" >
<sequence>
<module name="Magento_Cron"/>
</sequence>
Expand Down

0 comments on commit 4b7f115

Please sign in to comment.