Skip to content

feat(releases): save early to improve skip duplicates matching#1909

Open
zze0s wants to merge 2 commits intodevelopfrom
feature/releases-skip-duplicates-save-early
Open

feat(releases): save early to improve skip duplicates matching#1909
zze0s wants to merge 2 commits intodevelopfrom
feature/releases-skip-duplicates-save-early

Conversation

@zze0s
Copy link
Collaborator

@zze0s zze0s commented Dec 28, 2024

This is an experimental pr to improve the matching for skip duplicates with releases that are announced within seconds of each other.

  • Store the release as early as possible and change the checks for duplicates to not look at Release Action Statuses.

From("release r").
LeftJoin("release_action_status ras ON r.id = ras.release_id").
Where("ras.status = 'PUSH_APPROVED'")
Where(sq.Or{sq.Eq{"r.filter_status": domain.ReleaseStatusFilterApproved}, sq.Eq{"r.filter_status": domain.ReleaseStatusFilterPending}})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We currently have that bug where pending can last forever without a valid push. It's gotten better with those http timeouts, but a script that never exits will hit the same issue I think? On paper this might be closer to the right mechanism, but I think you want to clear pending on startup with an internal state failure logged.

@kenstir
Copy link
Contributor

kenstir commented Feb 27, 2025

This PR will help. Is the only thing missing the startup check that @KyleSanderson suggests? I dug deep into why my filter did not skip dups or download only 1 episode per day, and it was due to the delay caused by setting status=Approved only after ReannounceTorrentWithRetry returns.

@zze0s
Copy link
Collaborator Author

zze0s commented Jun 10, 2025

Coming back to this after some time and thinking:

We could add a new option to client actions with something like "Wait for re-announce" and make it opt-in, or opt-out, and let re-announce run in the background without blocking/waiting.

That should improve things when it doesn't have to wait. And the goal is still to find a better solution for in-flight items but that will take a lot longer still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants