<commit_before>from time import sleep
import celery
import logging
import pytz
from datetime import datetime, timedelta
import raven
import copy
import yaml
import backoff


from meerkat_abacus import tasks
from meerkat_abacus import celeryconfig
from meerkat_abacus.config import config
from meerkat_abacus import util
from meerkat_abacus import data_management
from meerkat_abacus import data_import


# from meerkat_abacus.internal_buffer import InternalBuffer
from queue import Queue


@backoff.on_exception(backoff.expo,
                      (celery.exceptions.TimeoutError,
                       AttributeError, OSError),
                      max_tries=8,
                      max_value=30)
def wait_for_celery_runner():
    test_task = tasks.test_up.delay()
    result = test_task.get(timeout=1)
    return result



class Celery(celery.Celery):
    def on_configure(self):
        if config.sentry_dns:
            client = raven.Client(config.sentry_dns)
            # register a custom filter to filter out duplicate logs
            register_logger_signal(client)
            # hook into the Celery error handler
            register_signal(client)

app = Celery()
app.config_from_object(celeryconfig)
logging.getLogger().setLevel(logging.INFO)

wait_for_celery_runner()

app.control.purge()
logging.info("Setting up DB for %s", config.country_config["country_name"])
global engine<commit_msg>Increasing waiting time for runner.<commit_after>from time import sleep
import celery
import logging
import pytz
from datetime import datetime, timedelta
import raven
import copy
import yaml
import backoff


from meerkat_abacus import tasks
from meerkat_abacus import celeryconfig
from meerkat_abacus.config import config
from meerkat_abacus import util
from meerkat_abacus import data_management
from meerkat_abacus import data_import


# from meerkat_abacus.internal_buffer import InternalBuffer
from queue import Queue


@backoff.on_exception(backoff.expo,
                      (celery.exceptions.TimeoutError,
                       AttributeError, OSError),
                      max_tries=10,
                      max_value=30)
def wait_for_celery_runner():
    test_task = tasks.test_up.delay()
    result = test_task.get(timeout=1)
    return result



class Celery(celery.Celery):
    def on_configure(self):
        if config.sentry_dns:
            client = raven.Client(config.sentry_dns)
            # register a custom filter to filter out duplicate logs
            register_logger_signal(client)
            # hook into the Celery error handler
            register_signal(client)

app = Celery()
app.config_from_object(celeryconfig)
logging.getLogger().setLevel(logging.INFO)

wait_for_celery_runner()

app.control.purge()
logging.info("Setting up DB for %s", config.country_config["country_name"])
global engine
{'fraction_non_alphanumeric': 0.06164142303628038, 'fraction_numerical': 0.0031701303275801338, 'mean_word_length': 3.3962848297213624, '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': '4306606', 'n_tokens_mistral': 854, 'n_tokens_neox': 821, 'n_words': 219}