<commit_before><?php
/**
 * Author: jack<<EMAIL>>
 * Date: 15/8/31
 */

namespace Mage\Task\BuiltIn\Symfony2;

use Exception;
use Mage\Task\ErrorWithMessageException;
use Mage\Task\SkipException;

/**
 * Class RestartQueueTask
 * @package Mage\Task\BuiltIn\Symfony2
 */
class RestartQueueTask extends SymfonyAbstractTask
{
    /**
     * @return string
     */
    public function getName()
    {
        return 'Symfony v2 - Restart resque schedule process and workers [built-in]';
    }

    /**
     * @return bool
     */
    public function run()
    {
        $workers = $this->getParameter('workers_option', array());

        $command = sprintf('%s resque:scheduledworker-stop --quiet', $this->getAppPath());
        $this->runCommand($command);
        $command = sprintf('%s resque:worker-stop -a --quiet', $this->getAppPath());
        $this->runCommand($command);
        $command = sprintf('%s resque:scheduledworker-start -i 1', $this->getAppPath());
        $this->runCommand($command);

        foreach ($workers as $worker) {
            $command = sprintf('%s resque:worker-start %s', $this->getAppPath(), $worker);
            $this->runCommand($command);
        }

        return true;
    }
}<commit_msg>fix new process not ssh remote command waiting output issue<commit_after><?php
/**
 * Author: jack<<EMAIL>>
 * Date: 15/8/31
 */

namespace Mage\Task\BuiltIn\Symfony2;

use Exception;
use Mage\Task\ErrorWithMessageException;
use Mage\Task\SkipException;

/**
 * Class RestartQueueTask
 * @package Mage\Task\BuiltIn\Symfony2
 */
class RestartQueueTask extends SymfonyAbstractTask
{
    /**
     * @return string
     */
    public function getName()
    {
        return 'Symfony v2 - Restart resque schedule process and workers [built-in]';
    }

    /**
     * @return bool
     */
    public function run()
    {
        $workers = $this->getParameter('workers_option', array());

        $command = sprintf('%s resque:scheduledworker-stop --quiet', $this->getAppPath());
        $this->runCommand($command);
        $command = sprintf('%s resque:worker-stop -a --quiet', $this->getAppPath());
        $this->runCommand($command);
        $command = sprintf('%s resque:scheduledworker-start -i 1 --quiet >> /dev/null &', $this->getAppPath());
        $this->runCommand($command);

        foreach ($workers as $worker) {
            $command = sprintf('%s resque:worker-start %s --quiet >> /dev/null &', $this->getAppPath(), $worker);
            $this->runCommand($command);
        }

        return true;
    }
}
{'fraction_non_alphanumeric': 0.1580188679245283, 'fraction_numerical': 0.007075471698113208, 'mean_word_length': 2.798507462686567, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6431396', 'n_tokens_mistral': 793, 'n_tokens_neox': 770, 'n_words': 167}