Add db
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"downloader/internal/core/ports/download_request"
|
||||
"downloader/internal/core/ports/downloadhandler"
|
||||
"fmt"
|
||||
@@ -20,7 +21,7 @@ func New(repository download_request.Repository, logger *zap.SugaredLogger) down
|
||||
}
|
||||
|
||||
func (o *onDownloadEventHandler) OnTickEvent(downloadId string, progress string) {
|
||||
download, err := o.repository.GetById(downloadId)
|
||||
download, err := o.repository.GetById(context.TODO(), downloadId)
|
||||
if err != nil {
|
||||
o.logger.Warnw("could not finish updating progress as not download id available",
|
||||
"downloadId", downloadId,
|
||||
@@ -28,5 +29,5 @@ func (o *onDownloadEventHandler) OnTickEvent(downloadId string, progress string)
|
||||
return
|
||||
}
|
||||
download.Status = fmt.Sprintf("in-progress: %s", progress)
|
||||
_ = o.repository.Update(download)
|
||||
_ = o.repository.Update(context.TODO(), download)
|
||||
}
|
||||
|
Reference in New Issue
Block a user