Stop redirecting all output to the messages field of this Schedule.
We use ob_end_flush to stop redirecting the output.

@return $this
519080
protected function _stopBufferToMessages()
    {
        if (!Mage::getStoreConfigFlag('system/cron/enableJobOutputBuffer')) {
            return $this;
        }

        if (!$this->_redirect) {
            return $this;
        }

        ob_end_flush();
        $this->addMessages('---END---' . PHP_EOL);

        $this->_redirect = false;

        return $this;
    }
574846
public function flushOuputBuffer()
    {
        //====================================================================//
        // Read the contents of the output buffer
        $contents = ob_get_contents();
        //====================================================================//
        // Clean (erase) the output buffer and turn off output buffering
        ob_end_clean();
        if ($contents) {
            //====================================================================//
            //  Load Translation File
            Splash::translator()->load('main');
            //====================================================================//
            //  Push Warning to Log
            $this->war('UnexOutputs', $contents);
            $this->war('UnexOutputsMsg');
        }
    }
827837
private function flush()
    {
        $keepWriting = true;
        while ($keepWriting) {
            $message = $this->messages[0]['message'];
            $promise = $this->messages[0]['promise'];

            $bytesWritten = @fwrite($this->output, $message);

            if ($bytesWritten > 0) {
                $message = substr($message, $bytesWritten);
            }

            // Determine if this message was completely sent
            if (strlen($message) === 0) {
                array_shift($this->messages);

                // This was the last message in the queue, remove the write handler.
                if (count($this->messages) === 0) {
                    Loop\removeWriteStream($this->output);
                    $keepWriting = false;
                }

                $promise->fulfill();
            } else {
                $this->messages[0]['message'] = $message;
                $keepWriting = false;
            }
        }
    }
792188
public function flushAll()
    {
        foreach ($this->drivers as $driver) {
            $driver->flushAll();
        }

        $this->registry = [];
        $this->save();

        return $this;
    }
14374
public function flush()
    {
        //todo bugfix batch record
        foreach ($this->deferLogs as $k => $deferLog) {
            $this->record($deferLog['message'], $deferLog['context'], $deferLog['level'], $deferLog['role']);
            $this->removeDeferLog($k);
        }
    }
1157311
public function flush()
    {
        /** @var Node $node */
        foreach ($this->getFolder()->getNodes() as $node) {
            if ($node->details->isFile()) {
                $node->delete();
            }
        }

        return $this;
    }
352616
public function clearRows()
    {
        $this->downloader->clearRows();
        $this->outputter->clearRows();
        $this->writer->clearRows();

        return $this;
    }
643347
public function stop()
    {
        $data = phpdbg_end_oplog();
        $result = [];
        foreach ($data as $file => $coverage) {
            foreach ($coverage as $line => $value) {
                $result[$file][$line - 1] = $value <= 0 ? 0 : 1;
            }
        }
        return $result;
    }
196852
private function endOutputBuffer($output = null): void
    {
        // handle redirections
        $statusCode = $this->response->status()->getCode();
        if ($statusCode >= 300 && $statusCode <= 399) {
            // clean & turn off output buffering
            while (ob_get_level()) {
                ob_end_clean();
            }
            $this->response->body()->setContentType('none');
        }
        // handle outputs
        else {
            // echo'd or print'ed service methods return 'null'
            if ($output === null) {
                $output = '';
                while (ob_get_level()) {
                    $output .= ob_get_clean();
                }
            }

            // call user output handler if provided
            if ($this->events->has('app.output')) {
                $output = $this->events->fire('app.output', $output);
            }

            $this->response->setBody($output);
        }

        $this->response->end();
    }
684393
public function stopBenchmark()
    {
        $this->_benchmark_stoptime = microtime(true);
        $this->log(SMARTIRC_DEBUG_NOTICE, 'benchmark stopped', __FILE__, __LINE__);

        if ($this->_benchmark) {
            $this->showBenchmark();
        }
        return $this;
    }
187322
function clear() {
        if($this !== $this->client->channels) {
            foreach($this->data as $key => $val) {
                $this->client->channels->delete($key);
                unset($val);
            }
        }
        
        parent::clear();
        return $this;
    }
1034573
public function destroy()
    {
        $this->redis->flushDb();
        $this->close();
        $this->redis = null;

        return $this;
    }
416001
public static function stop()
    {
        if (self::$mode === self::MODE_DISABLED) {
            return;
        }

        $mode = self::$mode;

        if (self::$trace['tx'] === 'default' && self::$extension === self::EXTENSION_TIDEWAYS) {
            self::$trace['tx'] = tideways_transaction_name() ?: 'default';
        }

        if (function_exists('tideways_last_detected_exception') && $exception = tideways_last_detected_exception()) {
            self::logException($exception);
        } elseif (function_exists("http_response_code") && http_response_code() >= 500) {
            self::logFatal("PHP request set error HTTP response code to '" . http_response_code() . "'.", "", 0, E_USER_ERROR);
        }

        $profilingData = array();

        if (($mode & self::MODE_FULL) > 0 || self::$error) {
            if (self::$extension === self::EXTENSION_TIDEWAYS) {
                $profilingData = tideways_disable();
            } elseif (self::$extension === self::EXTENSION_XHPROF) {
                $profilingData = xhprof_disable();
                self::$currentRootSpan->stopTimer();
            }

            $annotations = array('mem' => ceil(memory_get_peak_usage() / 1024));

            if (self::$extension === self::EXTENSION_TIDEWAYS) {
                $annotations['xhpv'] = phpversion('tideways');

                if (self::$defaultOptions['framework']) {
                    $annotations['framework'] = self::$defaultOptions['framework'];
                }
            } elseif (self::$extension === self::EXTENSION_XHPROF) {
                $annotations['xhpv'] = phpversion('xhprof');
            }

            if (extension_loaded('xdebug')) {
                $annotations['xdebug'] = '1';
            }
            $annotations['php'] = PHP_VERSION;
            $annotations['sapi'] = php_sapi_name();

            if (isset($_SERVER['REQUEST_URI'])) {
                $annotations['title'] = '';
                if (isset($_SERVER['REQUEST_METHOD'])) {
                    $annotations['title'] = $_SERVER["REQUEST_METHOD"] . ' ';
                }

                if (isset($_SERVER['HTTP_HOST'])) {
                    $annotations['title'] .= (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . self::getRequestUri();
                } elseif(isset($_SERVER['SERVER_ADDR'])) {
                    $annotations['title'] .= (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['SERVER_ADDR'] . self::getRequestUri();
                }

                if (isset($_SERVER['QUERY_STRING'])) {
                    $annotations['query'] = $_SERVER['QUERY_STRING'];
                }

            } elseif ($annotations['sapi'] === "cli") {
                $annotations['title'] = basename($_SERVER['argv'][0]);
            }
        } else {
            self::$currentRootSpan->stopTimer();
            $annotations = array('mem' => ceil(memory_get_peak_usage() / 1024));
        }

        self::$currentRootSpan->annotate($annotations);

        if (($mode & self::MODE_PROFILING) > 0) {
            self::$trace['profdata'] = $profilingData ?: array();
        }

        self::$mode = self::MODE_DISABLED;

        $spans = self::$currentRootSpan->getSpans();

        if (self::$error === true || ($mode & self::MODE_FULL) > 0) {
            self::$trace['spans'] = $spans;
            self::$backend->socketStore(self::$trace);
        } else {
            self::$trace['spans'] = isset($spans[0]) ? array($spans[0]) : array(); // prevent flooding udp by accident
            self::$backend->socketStoreMeasurement(self::$trace);
        }
        self::$trace = null; // free memory
        self::$logLevel = 0;
    }
1017185
public function flush()
    {
        $output = $this->getXml()->flush();
        fwrite($this->resource, $output);
        return $this;
    }
230214
public function chunk()
    {
        if (false === $this->chunked) {
            $this->chunked = true;
            $this->header('Transfer-encoding', 'chunked');
            flush();
        }

        if (($body_length = strlen($this->body)) > 0) {
            printf("%x\r\n", $body_length);
            $this->sendBody();
            $this->body('');
            echo "\r\n";
            flush();
        }

        return $this;
    }
1027716
public function flush(){
        if (!$this->source || !$this->emitter){
            return $this;
        }
        while($e = $this->source->next()){
            if (is_string($e)){
                $this->emitter->emit($e);
            }
            elseif (is_array($e) && count($e)===2){
                list($event, $args) = $e;
                $this->emitter->emit($event, $args);
            }
            elseif ($e!==null){
                throw new \DomainException('datasource returns invalid event:' . print_r($e,true));
            }
        }
        return $this;
    }
628223
public function stop()
    {
        $time = microtime(true);
        $this->time += $time - $this->start;
        $this->start = $time;
        return $this;
    }