diff --git a/beat/web/backend/migrations/0002_scheduler_addons.py b/beat/web/backend/migrations/0002_scheduler_addons.py index 93525606a1de77ad93915a18d4ab44dea518e035..ee14da860549143d2ff2c478d93ebe05eddbbead 100644 --- a/beat/web/backend/migrations/0002_scheduler_addons.py +++ b/beat/web/backend/migrations/0002_scheduler_addons.py @@ -88,6 +88,16 @@ class Migration(migrations.Migration): name='used_memory', field=models.PositiveIntegerField(default=0, help_text=b'In %'), ), + migrations.AddField( + model_name='worker', + name='update', + field=models.BooleanField(default=False, help_text='If this worker state must be updated at the next cycle'), + ), + migrations.AddField( + model_name='worker', + name='updated', + field=models.DateTimeField(auto_now=True, null=True), + ), migrations.AlterField( model_name='queue', name='name', diff --git a/beat/web/backend/models.py b/beat/web/backend/models.py index 503aefa24be053c7474508934da20541d407aa66..f4fbd02ec2200cf5b631170723e1dfb1ce634e9d 100644 --- a/beat/web/backend/models.py +++ b/beat/web/backend/models.py @@ -179,6 +179,13 @@ class Worker(models.Model): default=False, ) + update = models.BooleanField( + help_text=u'If this worker state must be updated at the next cycle', + default=False, + ) + + updated = models.DateTimeField(null=True, auto_now=True) + cores = models.PositiveIntegerField() memory = models.PositiveIntegerField(default=0, help_text='In megabytes') diff --git a/beat/web/settings/settings.py b/beat/web/settings/settings.py index fdf898e705ff5b9c30806c862ee05e2dad098344..1b20dddf2fe7d6a01772afebf517215efef5c6b7 100644 --- a/beat/web/settings/settings.py +++ b/beat/web/settings/settings.py @@ -225,12 +225,6 @@ SCHEDULING_INTERVAL = 5 #seconds # a particular worker will run to verify jobs are not scheduled to itself WORKER_INTERVAL = 5 #seconds -# This is the frequency in seconds, in which the worker will update information -# about its internal state to the database. It is typically larger (much -# larger) than the WORKER_INTERVAL to avoid overloading the database with -# unnecessary requests. -WORKER_STATE_UPDATE = 60 #seconds - # The maximum index split errors control the maximum number of times we can # incur in an index split error condition without cancelling the block # execution altogether. This number, multiplied by the scheduling interval,