Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/__init__.py
# Copyright (C) 2018 The Software Heritage developers | # Copyright (C) 2018 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
# Percentage of tasks with priority to schedule | # Percentage of tasks with priority to schedule | ||||
PRIORITY_SLOT = 0.6 | PRIORITY_SLOT = 0.6 | ||||
DEFAULT_CONFIG_PATH = 'backend/scheduler' | |||||
DEFAULT_CONFIG = { | |||||
'scheduler': ('dict', { | |||||
'cls': 'local', | |||||
'args': { | |||||
'db': 'dbname=softwareheritage-scheduler-dev', | |||||
}, | |||||
}) | |||||
} | |||||
def compute_nb_tasks_from(num_tasks): | def compute_nb_tasks_from(num_tasks): | ||||
"""Compute and returns the tuple, number of tasks without priority, | """Compute and returns the tuple, number of tasks without priority, | ||||
number of tasks with priority. | number of tasks with priority. | ||||
Args: | Args: | ||||
num_tasks (int): | num_tasks (int): | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |