-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for possible duplicate file_complete reports for any given file.
The celery transaction model settings to guarantee we never lose a file could result in duplicate file reports. Handle this by adding a unique key to the transformation_result table. Attempt to insert the record and just report a warning if that fails, but don't increment the file counter.
- Loading branch information
1 parent
4a4ca9a
commit 0e4d51d
Showing
6 changed files
with
162 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Add unique constraint to TransformResult on request_id and file_id | ||
Revision ID: 1.5.7 | ||
Revises: v1_5_6 | ||
Create Date: 2025-01-13 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'v1_5_7' | ||
down_revision = 'v1_5_6' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
def upgrade(): | ||
# Add unique constraint | ||
op.create_unique_constraint('uix_file_request', 'transform_result', ['file_id', 'request_id']) | ||
|
||
|
||
def downgrade(): | ||
# Remove unique constraint | ||
op.drop_constraint('uix_file_request', 'transform_result', type_='unique') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.