rename scheduler config singleton

This commit is contained in:
Chris Meyers 2016-11-01 14:07:00 -05:00
parent e1a84f4c85
commit 25b85c4a0b
3 changed files with 4 additions and 4 deletions

View File

@ -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)),

View File

@ -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):

View File

@ -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