<commit_before>#include "SimplePage.h"
#include <QtCore/QFile>
#include <QtCore/QTimer>
#include <QtCore/QCoreApplication>

namespace web {
namespace page {

class SimplePagePrivate
{
    public:
        QFile file;
        QByteArray data;
        QTimer timer;
};

const qint32 CACHE_INTERVAL = 1000 * 60;

SimplePage::SimplePage(QString fileName) :
    SimplePage(new SimplePagePrivate, fileName)
{
}

QByteArray SimplePage::getContent()
{
    Q_D(SimplePage);

    if ( d->data.isEmpty() ) {
            d->file.open( QIODevice::ReadOnly );

            while ( !d->file.atEnd() ) {
                    d->data.append(d->file.read(10000));
                    QCoreApplication::processEvents();
                }

            d->file.close();

            d->timer.setInterval( CACHE_INTERVAL );

            QObject::connect( &d->timer, &QTimer::timeout, [=]() {
                    d->data.clear();
                });

            d->timer.start();
        }<commit_msg>Files shouldnt be surely not 1 mb<commit_after>#include "SimplePage.h"
#include <QtCore/QFile>
#include <QtCore/QTimer>
#include <QtCore/QCoreApplication>

namespace web {
namespace page {

class SimplePagePrivate
{
    public:
        QFile file;
        QByteArray data;
        QTimer timer;
};

const qint32 CACHE_INTERVAL = 1000 * 60 * 60;

SimplePage::SimplePage(QString fileName) :
    SimplePage(new SimplePagePrivate, fileName)
{
}

QByteArray SimplePage::getContent()
{
    Q_D(SimplePage);

    if ( d->data.isEmpty() ) {
            d->file.open( QIODevice::ReadOnly );

            while ( !d->file.atEnd() ) {
                    d->data.append(d->file.read(800));
                    QCoreApplication::processEvents();
                }

            d->file.close();

            d->timer.setInterval( CACHE_INTERVAL );

            QObject::connect( &d->timer, &QTimer::timeout, [=]() {
                    d->data.clear();
                });

            d->timer.start();
        }
{'fraction_non_alphanumeric': 0.13808801213960548, 'fraction_numerical': 0.013657056145675266, 'mean_word_length': 2.066666666666667, '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': '5595404', 'n_tokens_mistral': 643, 'n_tokens_neox': 602, 'n_words': 107}