Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
W Wiki
  • Project overview
    • Project overview
    • Details
    • Activity
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
Collapse sidebar
  • Tutoriais
  • Wiki
  • Wiki
    • Magento
  • MagentoCronChecker

MagentoCronChecker · Changes

Page history
Create Magento/MagentoCronChecker authored Apr 04, 2019 by Jonatan Machado's avatar Jonatan Machado
Hide whitespace changes
Inline Side-by-side
Showing with 102 additions and 0 deletions
+102 -0
  • Magento/MagentoCronChecker.md Magento/MagentoCronChecker.md +102 -0
  • No files found.
Magento/MagentoCronChecker.md 0 → 100644
View page @ fa8497ee
``
<?php
chdir(dirname(__FILE__));
require 'app/Mage.php';
if (!Mage::isInstalled()) {
echo "O aplicativo ainda não está instalado, por favor, conclua o assistente de instalação primeiro.";
exit;
}
echo '<head><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="viewport" content="width=device-width, initial-scale=1.0"></head>';
echo '<img style="-webkit-user-select: none;" src="http://www.ceicom.com.br/img/logo.png?v=1.0">';
echo '<style>';
echo 'body{color: #666;text-align: center;font-family: sans-serif;font-size: 16px;}';
echo 'a{text-decoration: none;color: #666;font-weight: 600;}';
echo 'a:hover {text-decoration: underline;}';
echo '</style>';
// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);
Mage::app('admin')->setUseSessionInUrl(false);
if (!defined('MAGENTO_ROOT')) {
define('MAGENTO_ROOT', getcwd());
}
$time = Mage::getSingleton('core/date')->gmtTimestamp();
$istalledAt = strtotime(Mage::getConfig()->getNode('global/install/date'));
if ($time < $istalledAt + 3600) { ?>
<h4>Impossível detectar. Este instantâneo do Magento foi instalado há menos de uma hora. Por favor tente mais tarde.</h4>
<?php } else {
$cronSchedule = Mage::getSingleton('cron/schedule');
$collection = $cronSchedule->getCollection()
->addFieldToFilter('scheduled_at', array('gteq' => date('Y-m-d H:i:s', $time - 3600)))
->setPageSize(1);
if (!count($collection)) {
?>
<h4>Magento cron job está perdendo no seu crontab. <span style="color: #ff1117;">(OK)</span></h4>
Nos sistemas UNIX / BSD / linux você precisará adicionar esta linha (ou uma linha similar) ao seu crontab:<br/>
<strong>0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/sh <?php echo MAGENTO_ROOT ?>/cron.sh</strong>
<br/><br/>
Para isso, você pode usar o comando "crontab -e" no shell ou usar o painel de hospedagem.
<br/><br/>
<hr/>
<h5>Observe que, se você configurou recentemente uma tarefa cron e ainda vê um erro, aguarde 30 minutos e tente novamente.</h5>
<?php } else { ?>
<h4>Magento cron job está instalado no seu crontab. <span style="color: #00a000;">(OK)</span></h4>
<?php
$collection = $cronSchedule->getCollection()
->addFieldToFilter('executed_at', array('gteq' => date('Y-m-d H:i:s', $time - 3600 * 2)))
->addFieldToFilter(
array('status', 'status'),
array(
array('eq'=>Mage_Cron_Model_Schedule::STATUS_MISSED),
array('eq'=>Mage_Cron_Model_Schedule::STATUS_ERROR),
)
)
->setPageSize(100);
if (count($collection)) { ?>
<h5>No entanto, você ainda tem alguns problemas:</h5>
<table cellspacing="0" cellpadding="5" border="1">
<tr>
<?php foreach($collection->getFirstItem()->getData() as $key => $value) { ?>
<td><?php echo htmlspecialchars($key) ?></td>
<?php } ?>
</tr>
<?php foreach($collection as $item) { ?>
<tr>
<?php foreach($item->getData() as $value) { ?>
<td><?php echo htmlspecialchars($value) ?></td>
<?php } ?>
</tr>
<?php } ?>
</table>
<?php } else { ?>
<h4>Cron funciona bem. <span style="color: #00a000;">(OK)</span></h4>
<?php } ?>
<?php } ?>
<?php } ?>
<br/>
<a href="http://ceicom.com.br/" target="_blank" title="Ceicom.com.br">
Ceicom. &#169; <?php echo date('Y') ?>
</a>
``
\ No newline at end of file
Clone repository
  • Gitlab
    • Comandos
  • Hotfix
    • og:image
  • Magento
    • Htaccess
    • MagentoCronChecker
    • Robots
    • SimpleSchema
    • Soap v2 Tester
    • gitignore
  • Migração
    • leg.br
  • Padrões
    • eslint
    • prettier
  • Plugins
    • Adicionar informações extras ao texto copiado da web
  • QueryCommerce
  • Servidores
    • Cloudways
    • DnsMadeEasy
View All Pages