mirror of
https://git.sr.ht/~phw/scotty
synced 2025-06-07 05:18:33 +02:00
Pass context to export backends
This commit is contained in:
parent
b5bca1d4ab
commit
26d9f5e840
12 changed files with 55 additions and 33 deletions
|
@ -73,8 +73,7 @@ func (b *ListenBrainzApiBackend) InitConfig(config *config.ServiceConfig) error
|
|||
func (b *ListenBrainzApiBackend) StartImport() error { return nil }
|
||||
func (b *ListenBrainzApiBackend) FinishImport() error { return nil }
|
||||
|
||||
func (b *ListenBrainzApiBackend) ExportListens(oldestTimestamp time.Time, results chan models.ListensResult, progress chan models.TransferProgress) {
|
||||
ctx := context.TODO()
|
||||
func (b *ListenBrainzApiBackend) ExportListens(ctx context.Context, oldestTimestamp time.Time, results chan models.ListensResult, progress chan models.TransferProgress) {
|
||||
startTime := time.Now()
|
||||
minTime := oldestTimestamp
|
||||
if minTime.Unix() < 1 {
|
||||
|
@ -201,8 +200,7 @@ func (b *ListenBrainzApiBackend) ImportListens(export models.ListensResult, impo
|
|||
return importResult, nil
|
||||
}
|
||||
|
||||
func (b *ListenBrainzApiBackend) ExportLoves(oldestTimestamp time.Time, results chan models.LovesResult, progress chan models.TransferProgress) {
|
||||
ctx := context.TODO()
|
||||
func (b *ListenBrainzApiBackend) ExportLoves(ctx context.Context, oldestTimestamp time.Time, results chan models.LovesResult, progress chan models.TransferProgress) {
|
||||
exportChan := make(chan models.LovesResult)
|
||||
p := models.TransferProgress{
|
||||
Export: &models.Progress{},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue