<commit_before>"""
Burp-UI is a web-ui for burp backup written in python with Flask and
jQuery/Bootstrap

.. module:: burpui.tasks
    :platform: Unix
    :synopsis: Burp-UI tasks module.

.. moduleauthor:: Ziirish <<EMAIL>>
"""
import sys
import os

from six import iteritems
from flask import current_app
from datetime import timedelta, datetime
from celery.schedules import crontab
from celery.utils.log import get_task_logger
from time import gmtime, strftime, sleep

# Try to load modules from our current env first
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))

from burpui._compat import PY3  # noqa
from burpui.config import config  # noqa
from burpui.ext.async import celery  # noqa
from burpui.ext.cache import cache  # noqa
from burpui.sessions import session_manager  # noqa
from burpui.server import BUIServer  # noqa
from burpui.exceptions import BUIserverException  # noqa
from burpui.api.client import ClientTreeAll  # noqa

try:
    from .ext.ws import socketio
    WS_AVAILABLE = True
except ImportError:
    WS_AVAILABLE = False

if not PY3:
    from itertools import imap as map

if config.get('WITH_SQL'):
    from burpui.ext.sql import db
else:
    db = None

bui = current_app  # type: BUIServer
logger = get_task_logger(__name__)
ME = __name__

LOCK_EXPIRE = 60 * 30  # Lock expires in 30 minutes

BEAT_SCHEDULE = {
    'ping-backend-hourly': {
        'task': '{}.ping_backend'.format(ME),
        'schedule': crontab(minute='15'),  # run every hour
    },
    'backup-running-minutely': {
        'task': '{}.backup_running'.format(ME),
        'schedule': timedelta(seconds=30),  # run every 30 seconds
    },<commit_msg>check running backups more frequently<commit_after>"""
Burp-UI is a web-ui for burp backup written in python with Flask and
jQuery/Bootstrap

.. module:: burpui.tasks
    :platform: Unix
    :synopsis: Burp-UI tasks module.

.. moduleauthor:: Ziirish <<EMAIL>>
"""
import sys
import os

from six import iteritems
from flask import current_app
from datetime import timedelta, datetime
from celery.schedules import crontab
from celery.utils.log import get_task_logger
from time import gmtime, strftime, sleep

# Try to load modules from our current env first
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))

from burpui._compat import PY3  # noqa
from burpui.config import config  # noqa
from burpui.ext.async import celery  # noqa
from burpui.ext.cache import cache  # noqa
from burpui.sessions import session_manager  # noqa
from burpui.server import BUIServer  # noqa
from burpui.exceptions import BUIserverException  # noqa
from burpui.api.client import ClientTreeAll  # noqa

try:
    from .ext.ws import socketio
    WS_AVAILABLE = True
except ImportError:
    WS_AVAILABLE = False

if not PY3:
    from itertools import imap as map

if config.get('WITH_SQL'):
    from burpui.ext.sql import db
else:
    db = None

bui = current_app  # type: BUIServer
logger = get_task_logger(__name__)
ME = __name__

LOCK_EXPIRE = 60 * 30  # Lock expires in 30 minutes

BEAT_SCHEDULE = {
    'ping-backend-hourly': {
        'task': '{}.ping_backend'.format(ME),
        'schedule': crontab(minute='15'),  # run every hour
    },
    'backup-running-4-minutely': {
        'task': '{}.backup_running'.format(ME),
        'schedule': timedelta(seconds=15),  # run every 15 seconds
    },
{'fraction_non_alphanumeric': 0.09799882283696291, 'fraction_numerical': 0.009123013537374927, 'mean_word_length': 3.8008474576271185, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1016014', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1121, 'n_words': 346}