mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 15:27:47 -02:30
rename Scheduler to TaskManager
This commit is contained in:
@@ -34,7 +34,7 @@ from celery.task.control import inspect
|
|||||||
|
|
||||||
logger = logging.getLogger('awx.main.scheduler')
|
logger = logging.getLogger('awx.main.scheduler')
|
||||||
|
|
||||||
class Scheduler():
|
class TaskManager():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.graph = DependencyGraph()
|
self.graph = DependencyGraph()
|
||||||
self.capacity_total = 200
|
self.capacity_total = 200
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from celery import task
|
|||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.models import Instance
|
from awx.main.models import Instance
|
||||||
from awx.main.scheduler import Scheduler
|
from awx.main.scheduler import TaskManager
|
||||||
|
|
||||||
logger = logging.getLogger('awx.main.scheduler')
|
logger = logging.getLogger('awx.main.scheduler')
|
||||||
|
|
||||||
@@ -21,15 +21,15 @@ logger = logging.getLogger('awx.main.scheduler')
|
|||||||
|
|
||||||
@task
|
@task
|
||||||
def run_job_launch(job_id):
|
def run_job_launch(job_id):
|
||||||
Scheduler().schedule()
|
TaskManager().schedule()
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def run_job_complete(job_id):
|
def run_job_complete(job_id):
|
||||||
Scheduler().schedule()
|
TaskManager().schedule()
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def run_scheduler():
|
def run_scheduler():
|
||||||
Scheduler().schedule()
|
TaskManager().schedule()
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def run_fail_inconsistent_running_jobs():
|
def run_fail_inconsistent_running_jobs():
|
||||||
@@ -37,7 +37,7 @@ def run_fail_inconsistent_running_jobs():
|
|||||||
# Lock
|
# Lock
|
||||||
try:
|
try:
|
||||||
Instance.objects.select_for_update(nowait=True).all()[0]
|
Instance.objects.select_for_update(nowait=True).all()[0]
|
||||||
scheduler = Scheduler()
|
scheduler = TaskManager()
|
||||||
active_tasks = scheduler.get_active_tasks()
|
active_tasks = scheduler.get_active_tasks()
|
||||||
|
|
||||||
if active_tasks is None:
|
if active_tasks is None:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from awx.main.scheduler.partial import (
|
|||||||
InventoryUpdateDict,
|
InventoryUpdateDict,
|
||||||
InventorySourceDict,
|
InventorySourceDict,
|
||||||
)
|
)
|
||||||
from awx.main.scheduler import Scheduler
|
from awx.main.scheduler import TaskManager
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@@ -23,7 +23,7 @@ def epoch():
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def scheduler_factory(mocker, epoch):
|
def scheduler_factory(mocker, epoch):
|
||||||
def fn(tasks=[], inventory_sources=[], latest_project_updates=[], latest_inventory_updates=[], create_project_update=None, create_inventory_update=None):
|
def fn(tasks=[], inventory_sources=[], latest_project_updates=[], latest_inventory_updates=[], create_project_update=None, create_inventory_update=None):
|
||||||
sched = Scheduler()
|
sched = TaskManager()
|
||||||
sched.capacity_total = 999999999
|
sched.capacity_total = 999999999
|
||||||
|
|
||||||
sched.graph.get_now = lambda: epoch
|
sched.graph.get_now = lambda: epoch
|
||||||
|
|||||||
Reference in New Issue
Block a user