Closed ANIALLATOR114 closed 3 days ago
This pull request implements a unique constraint for real-time updates and adds a synchronous profiler. The main changes include modifying the GTFS real-time importer to use upsert operations, adding a unique constraint to the RTStopTimeModel, and introducing a new synchronous profiling decorator.
sequenceDiagram
participant C as Client
participant I as Importer
participant DB as Database
C->>I: import_stop_times(data)
I->>I: Process stop times
I->>DB: Prepare upsert statement
I->>DB: Execute upsert
DB-->>I: Confirmation
I-->>C: Import complete
Change | Details | Files |
---|---|---|
Implement upsert operation for real-time stop times |
|
SimplyTransport/lib/gtfs_realtime_importers.py |
Add unique constraint to RTStopTimeModel |
|
SimplyTransport/domain/realtime/stop_time/model.py migrations/main/versions/2024_09_30-5889d747e8a0_add_unique_constraint.py |
Introduce synchronous profiling decorator |
|
SimplyTransport/lib/profiling.py |
Minor documentation update |
|
SimplyTransport/cli.py |
Summary by Sourcery
Add a unique constraint to the 'rt_stop_time' table to ensure data integrity and modify the import process to use upsert operations. Introduce a new profiling decorator for synchronous functions to facilitate performance analysis. Update CLI documentation for clarity.
New Features:
Enhancements:
Build:
Documentation: