<commit_before># -*- coding: utf-8 -*-
import logging
from ...util.base import BaseStep

LOG = logging.getLogger(__name__)


class CheckDatabaseStatus(BaseStep):

    def __unicode__(self):
        return "Checking database status..."

    def do(self, workflow_dict):
        try:
            if not 'database' in workflow_dict:
                return False

            if not 'databaseinfra' in workflow_dict:
                workflow_dict['databaseinfra'] = workflow_dict[
                    'database'].databaseinfra

            LOG.info("Getting driver class")
            driver = workflow_dict['databaseinfra'].get_driver()
            from time import sleep

            sleep(60)

            if driver.check_status():
                LOG.info("Database is ok...")
                workflow_dict['database'].status = 1
                workflow_dict['database'].save()
                return True

            return False
        except Exception, e:
            LOG.info("Error: {}".format(e))
            pass

    def undo(self, workflow_dict):
        LOG.info("Nothing to do here...")
        return True<commit_msg>Change check database status to return even when it is false<commit_after># -*- coding: utf-8 -*-
import logging
from ...util.base import BaseStep

LOG = logging.getLogger(__name__)


class CheckDatabaseStatus(BaseStep):

    def __unicode__(self):
        return "Checking database status..."

    def do(self, workflow_dict):
        try:
            if 'database' not in workflow_dict:
                return False

            if 'databaseinfra' not in workflow_dict:
                workflow_dict['databaseinfra'] = workflow_dict[
                    'database'].databaseinfra

            LOG.info("Getting driver class")
            driver = workflow_dict['databaseinfra'].get_driver()
            from time import sleep

            sleep(60)

            if driver.check_status():
                LOG.info("Database is ok...")
                workflow_dict['database'].status = 1
                workflow_dict['database'].save()

            return True
        except Exception as e:
            LOG.info("Error: {}".format(e))
            pass

    def undo(self, workflow_dict):
        LOG.info("Nothing to do here...")
        return True
{'fraction_non_alphanumeric': 0.1020140105078809, 'fraction_numerical': 0.0035026269702276708, 'mean_word_length': 1.8209876543209877, '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': '134266', 'n_tokens_mistral': 610, 'n_tokens_neox': 550, 'n_words': 158}