mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
rename scheduler config singleton
This commit is contained in:
parent
e1a84f4c85
commit
25b85c4a0b
@ -12,7 +12,7 @@ class Migration(migrations.Migration):
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='TowerState',
|
||||
name='TowerScheduleState',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('schedule_last_run', models.DateTimeField(auto_now_add=True)),
|
||||
|
||||
@ -13,7 +13,7 @@ from awx.main.models.jobs import Job
|
||||
from awx.main.models.projects import ProjectUpdate
|
||||
from awx.main.models.unified_jobs import UnifiedJob
|
||||
|
||||
__all__ = ('Instance', 'JobOrigin', 'TowerState',)
|
||||
__all__ = ('Instance', 'JobOrigin', 'TowerScheduleState',)
|
||||
|
||||
|
||||
class Instance(models.Model):
|
||||
@ -35,7 +35,7 @@ class Instance(models.Model):
|
||||
# NOTE: TODO: Likely to repurpose this once standalone ramparts are a thing
|
||||
return "tower"
|
||||
|
||||
class TowerState(SingletonModel):
|
||||
class TowerScheduleState(SingletonModel):
|
||||
schedule_last_run = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class JobOrigin(models.Model):
|
||||
|
||||
@ -137,7 +137,7 @@ def cluster_node_heartbeat(self):
|
||||
@task(bind=True, queue='default')
|
||||
def tower_periodic_scheduler(self):
|
||||
run_now = now()
|
||||
state = TowerState.get_solo()
|
||||
state = TowerScheduleState.get_solo()
|
||||
last_run = state.schedule_last_run
|
||||
logger.debug("Last run was: %s", last_run)
|
||||
state.schedule_last_run = run_now
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user