<commit_before># tasks.py
from iati_synchroniser.models import IatiXmlSource
from django_rq import job
import django_rq
from django.http import HttpResponse
import datetime


###############################
######## WORKER TASKS  ########
###############################

@job
def start_worker(queue_name, amount_of_workers):
    from rq import Queue, Connection, Worker
    from redis import Redis

    redis_conn = Redis()
    queue = Queue('low', connection=redis_conn)

    amount_of_workers += 1

    with Connection():
        workername = "oipa-" + queue_name + "-" + str(amount_of_workers)
        w = Worker(queue, workername)
        w.work()
<commit_msg>worker bugfix #4<commit_after># tasks.py
from iati_synchroniser.models import IatiXmlSource
from django_rq import job
import django_rq
from django.http import HttpResponse
import datetime


###############################
######## WORKER TASKS  ########
###############################

@job
def start_worker(queue_name, amount_of_workers):
    from rq import Queue, Connection, Worker
    from redis import Redis

    redis_conn = Redis()
    queue = Queue('low', connection=redis_conn)

    amount_of_workers = int(amount_of_workers) + 1

    with Connection():
        workername = "oipa-" + queue_name + "-" + str(amount_of_workers)
        w = Worker(queue, workername)
        w.work()

{'fraction_non_alphanumeric': 0.18791451731761238, 'fraction_numerical': 0.002210759027266028, 'mean_word_length': 4.325490196078431, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6476937', 'n_tokens_mistral': 422, 'n_tokens_neox': 405, 'n_words': 105}