<commit_before>import os

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

import rq_dashboard
from flask_rq2 import RQ
from utils import add_basic_auth

app = Flask(__name__)

db = SQLAlchemy(app)
rq = RQ(app)

app.config.from_object(os.getenv('APP_SETTINGS', 'config.DevelopmentConfig'))

if not app.config.get('TESTING'):
    add_basic_auth(rq_dashboard.blueprint,
                   os.getenv('USER', 'admin'), os.getenv('PASSWORD', '[]'))

app.register_blueprint(rq_dashboard.blueprint, url_prefix='/monitor')


@app.route('/')
def hello():
    return 'Nothing to see here. :)'


if __name__ == '__main__':
    app.run()<commit_msg>update app.py<commit_after>import os

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

import rq_dashboard

from rq import Queue
from rq.job import Job

from worker import conn
from utils import add_basic_auth

app = Flask(__name__)

db = SQLAlchemy(app)

app.config.from_object(os.getenv('APP_SETTINGS', 'config.DevelopmentConfig'))

q = Queue(connection=conn)

if not app.config.get('TESTING'):
    add_basic_auth(rq_dashboard.blueprint,
                   os.getenv('USER', 'admin'), os.getenv('PASSWORD', '[]'))

app.register_blueprint(rq_dashboard.blueprint, url_prefix='/monitor')


def test():
    print('sknsjkfnknk')
    return 'Hello world, sample tasks.'


@app.route('/')
def hello():
    return 'Nothing to see here. :)'


if __name__ == '__main__':
    from scraper import scraper
    job = q.enqueue_call(func=test, result_ttl=5000)
    print(job.id)
    app.run()
{'fraction_non_alphanumeric': 0.12790697674418605, 'fraction_numerical': 0.003229974160206718, 'mean_word_length': 4.512455516014235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2685588', 'n_tokens_mistral': 555, 'n_tokens_neox': 535, 'n_words': 122}