feat: Add Linear action item syncing for incidents #139
1 issue
django-perf-review: Found 1 issue (1 high)
High
Write loop: update_or_create called per Linear issue in sync loop - `src/firetower/incidents/services.py:202-215`
The sync_action_items_from_linear function calls ActionItem.objects.update_or_create() inside a loop for each Linear issue (lines 202-215). With N issues, this executes N separate INSERT/UPDATE operations. Additionally, _resolve_assignee (lines 196-200) may trigger additional database calls per issue. While throttling (300s) and per-incident scoping limit impact, incidents with many action items will experience N+1 write latency.
Duration: 451.7s · Tokens: 1.1M in / 13.4k out · Cost: $2.16 (+extraction: $0.00)
Annotations
Check failure on line 215 in src/firetower/incidents/services.py
github-actions / warden: django-perf-review
Write loop: update_or_create called per Linear issue in sync loop
The sync_action_items_from_linear function calls ActionItem.objects.update_or_create() inside a loop for each Linear issue (lines 202-215). With N issues, this executes N separate INSERT/UPDATE operations. Additionally, _resolve_assignee (lines 196-200) may trigger additional database calls per issue. While throttling (300s) and per-incident scoping limit impact, incidents with many action items will experience N+1 write latency.