Add context to all methods in engine layer

This commit is contained in:
Deluan
2020-01-22 08:32:31 -05:00
parent c73f549c83
commit f0ee41a8af
14 changed files with 44 additions and 37 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ package engine
import (
"bytes"
"context"
"errors"
"image"
_ "image/gif"
@@ -17,7 +18,7 @@ import (
)
type Cover interface {
Get(id string, size int, out io.Writer) error
Get(ctx context.Context, id string, size int, out io.Writer) error
}
type cover struct {
@@ -49,7 +50,7 @@ func (c *cover) getCoverPath(id string) (string, error) {
return "", model.ErrNotFound
}
func (c *cover) Get(id string, size int, out io.Writer) error {
func (c *cover) Get(ctx context.Context, id string, size int, out io.Writer) error {
path, err := c.getCoverPath(id)
if err != nil && err != model.ErrNotFound {
return err