mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(releases): delete older than X (#993)
* fix(release): DeleteOlder func for zero duration resolves a bug in the `DeleteOlder` function where recent 24-hour data wasn't deleted when set to `delete everything`. We now correctly set the olderThanTimestamp to a future date when duration is zero, ensuring complete deletion of all records. * fix(releases): delete older --------- Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
56d3603505
commit
e6f32596a1
6 changed files with 56 additions and 71 deletions
|
@ -25,8 +25,7 @@ type Service interface {
|
|||
Stats(ctx context.Context) (*domain.ReleaseStats, error)
|
||||
Store(ctx context.Context, release *domain.Release) error
|
||||
StoreReleaseActionStatus(ctx context.Context, actionStatus *domain.ReleaseActionStatus) error
|
||||
Delete(ctx context.Context) error
|
||||
DeleteOlder(ctx context.Context, duration int) error
|
||||
Delete(ctx context.Context, req *domain.DeleteReleaseRequest) error
|
||||
Process(release *domain.Release)
|
||||
ProcessMultiple(releases []*domain.Release)
|
||||
Retry(ctx context.Context, req *domain.ReleaseActionRetryReq) error
|
||||
|
@ -91,12 +90,8 @@ func (s *service) StoreReleaseActionStatus(ctx context.Context, status *domain.R
|
|||
return s.repo.StoreReleaseActionStatus(ctx, status)
|
||||
}
|
||||
|
||||
func (s *service) Delete(ctx context.Context) error {
|
||||
return s.repo.Delete(ctx)
|
||||
}
|
||||
|
||||
func (s *service) DeleteOlder(ctx context.Context, duration int) error {
|
||||
return s.repo.DeleteOlder(ctx, duration)
|
||||
func (s *service) Delete(ctx context.Context, req *domain.DeleteReleaseRequest) error {
|
||||
return s.repo.Delete(ctx, req)
|
||||
}
|
||||
|
||||
func (s *service) Process(release *domain.Release) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue