Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: speed up finalizing proceedings #7846

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions ietf/meeting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

from django.conf import settings
from django.contrib import messages
from django.db.models import Q
from django.db.models import OuterRef, Subquery, TextField, Q, Value
from django.db.models.functions import Coalesce
from django.template.loader import render_to_string
from django.utils import timezone
from django.utils.encoding import smart_str
Expand Down Expand Up @@ -149,19 +150,27 @@ def create_proceedings_templates(meeting):


def bluesheet_data(session):
def affiliation(meeting, person):
# from OidcExtraScopeClaims.scope_registration()
email_list = person.email_set.values_list("address")
q = Q(person=person, meeting=meeting) | Q(email__in=email_list, meeting=meeting)
reg = MeetingRegistration.objects.filter(q).exclude(affiliation="").first()
return reg.affiliation if reg else ""

attendance = Attended.objects.filter(session=session).order_by("time")
meeting = session.meeting
attendance = (
Attended.objects.filter(session=session)
.annotate(
affiliation=Coalesce(
Subquery(
MeetingRegistration.objects.filter(
Q(meeting=session.meeting),
Q(person=OuterRef("person")) | Q(email=OuterRef("person__email")),
).values("affiliation")[:1]
),
Value(""),
output_field=TextField(),
)
).distinct()
.order_by("time")
)

return [
{
"name": attended.person.plain_name(),
"affiliation": affiliation(meeting, attended.person),
"affiliation": attended.affiliation,
}
for attended in attendance
]
Expand Down
4 changes: 4 additions & 0 deletions k8s/nginx-auth.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@ server {
proxy_set_header X-Forwarded-For $${keepempty}proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $${keepempty}remote_addr;
proxy_pass http://localhost:8000;
# Set timeouts longer than Cloudflare proxy limits
proxy_connect_timeout 60; # nginx default (Cf = 15)
proxy_read_timeout 120; # nginx default = 60 (Cf = 100)
proxy_send_timeout 60; # nginx default = 60 (Cf = 30)
}
}
4 changes: 4 additions & 0 deletions k8s/nginx-datatracker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ server {
proxy_set_header X-Forwarded-For $${keepempty}proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $${keepempty}remote_addr;
proxy_pass http://localhost:8000;
# Set timeouts longer than Cloudflare proxy limits
proxy_connect_timeout 60; # nginx default (Cf = 15)
proxy_read_timeout 120; # nginx default = 60 (Cf = 100)
proxy_send_timeout 60; # nginx default = 60 (Cf = 30)
client_max_body_size 0; # disable size check
}
}
Loading