Retention/quotas: something that 'seems to work' (doesn't immediately crash)

This commit is contained in:
Klaas van Schelven
2024-06-21 11:50:13 +02:00
parent c2b821589d
commit ea6aa9bbca
6 changed files with 100 additions and 41 deletions

View File

@@ -0,0 +1,16 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0002_initial'),
]
operations = [
migrations.AddField(
model_name='project',
name='retention_max_event_count',
field=models.PositiveIntegerField(default=10000),
),
]

View File

@@ -61,11 +61,12 @@ class Project(models.Model):
visibility = models.IntegerField(choices=ProjectVisibility.choices, default=ProjectVisibility.TEAM_MEMBERS)
# retention quota
retention_event_count_quota = models.PositiveIntegerField(default=10_000)
retention_max_event_count = models.PositiveIntegerField(default=10_000)
# bookkeeping of the eviction algorithm
retention_last_eviction = models.DateTimeField(null=True, blank=True)
retention_max_total_irrelevance = models.PositiveIntegerField(null=True, blank=True)
# this will be needed if/when we take an approach of 'drop immediately'
# retention_last_eviction = models.DateTimeField(null=True, blank=True)
# retention_max_total_irrelevance = models.PositiveIntegerField(null=True, blank=True)
def __str__(self):
return self.name