Pass context to export backends

This commit is contained in:
Philipp Wolfer 2025-05-22 11:09:39 +02:00
parent b5bca1d4ab
commit 26d9f5e840
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
12 changed files with 55 additions and 33 deletions

View file

@ -17,6 +17,7 @@ Scotty. If not, see <https://www.gnu.org/licenses/>.
package models
import (
"context"
"time"
// "go.uploadedlobster.com/scotty/internal/auth"
@ -55,7 +56,7 @@ type ListensExport interface {
// Returns a list of all listens newer then oldestTimestamp.
// The returned list of listens is supposed to be ordered by the
// Listen.ListenedAt timestamp, with the oldest entry first.
ExportListens(oldestTimestamp time.Time, results chan ListensResult, progress chan TransferProgress)
ExportListens(ctx context.Context, oldestTimestamp time.Time, results chan ListensResult, progress chan TransferProgress)
}
// Must be implemented by services supporting the import of listens.
@ -73,7 +74,7 @@ type LovesExport interface {
// Returns a list of all loves newer then oldestTimestamp.
// The returned list of listens is supposed to be ordered by the
// Love.Created timestamp, with the oldest entry first.
ExportLoves(oldestTimestamp time.Time, results chan LovesResult, progress chan TransferProgress)
ExportLoves(ctx context.Context, oldestTimestamp time.Time, results chan LovesResult, progress chan TransferProgress)
}
// Must be implemented by services supporting the import of loves.