refactor(csv_parser): Update training type resolution to use existing database cursor
Deploy Development / deploy (push) Successful in 48s
Build Test / pytest-backend (push) Successful in 4s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 16s

- Modified `_resolve_training_type_for_activity` to accept a database cursor, improving efficiency and avoiding potential deadlocks during CSV imports.
- Introduced `get_training_type_for_activity_with_cursor` to handle training type resolution with an existing cursor, streamlining database interactions.
- Updated related calls in the activity import logic to utilize the new function, ensuring consistent behavior across the application.
This commit is contained in:
Lars committed 2026-04-11 06:27:11 +02:00
1 parent a9bd3faabb
commit 894ee1dd02
3 files changed
+52 -32

No files matched your search

@@ -0,0 +1,9 @@
-- Universal-CSV-Import schreibt source = 'csv' (siehe csv_parser/executor _import_blood_pressure).
ALTER TABLE blood_pressure_log DROP CONSTRAINT IF EXISTS blood_pressure_log_source_check;
ALTER TABLE blood_pressure_log ADD CONSTRAINT blood_pressure_log_source_check
CHECK (source IN ('manual', 'omron', 'apple_health', 'withings', 'csv'));
COMMENT ON COLUMN blood_pressure_log.source IS
'manual | omron | apple_health | withings | csv (Universal-CSV-Import)';