[server][file-data] Fix query to mark replication as done
This commit is contained in:
committed by
Neeraj Gupta
parent
6fc24f6900
commit
cfadd700ff
@@ -196,9 +196,10 @@ func (r *Repository) GetPendingSyncDataAndExtendLock(ctx context.Context, newSyn
|
||||
return &fileData, nil
|
||||
}
|
||||
|
||||
// MarkReplicationAsDone marks the pending_sync as false for the file data row
|
||||
// MarkReplicationAsDone marks the pending_sync as false for the file data row, while
|
||||
// ensuring that the row is not deleted
|
||||
func (r *Repository) MarkReplicationAsDone(ctx context.Context, row filedata.Row) error {
|
||||
query := `UPDATE file_data SET pending_sync = false WHERE is_deleted=true and file_id = $1 AND data_type = $2 AND user_id = $3`
|
||||
query := `UPDATE file_data SET pending_sync = false WHERE is_deleted=false and file_id = $1 AND data_type = $2 AND user_id = $3`
|
||||
_, err := r.DB.ExecContext(ctx, query, row.FileID, string(row.Type), row.UserID)
|
||||
if err != nil {
|
||||
return stacktrace.Propagate(err, "")
|
||||
|
||||
Reference in New Issue
Block a user