mirror of
https://github.com/bugsink/bugsink.git
synced 2026-02-04 21:13:45 -06:00
Use .iterator() idiom in init_tags
to avoid loading all events into memory before looping over them There's some warnings in the docs about SQLite and iterators, but I don't think those apply, for one because we don't write to the events: https://docs.djangoproject.com/en/5.1/ref/databases/#sqlite-isolation
This commit is contained in:
@@ -19,7 +19,7 @@ class Command(BaseCommand):
|
||||
t0 = time.time()
|
||||
|
||||
try:
|
||||
for i, event in enumerate(Event.objects.all()):
|
||||
for i, event in enumerate(Event.objects.all().iterator()):
|
||||
# transaction per event: allows for interrupting the process without losing all progress; also allows
|
||||
# for your server to remain responsive during the process
|
||||
with immediate_atomic():
|
||||
|
||||
Reference in New Issue
Block a user