Skip to content

Commit

Permalink
Enable seeker interfaces from go-sfstreams
Browse files Browse the repository at this point in the history
For #457
  • Loading branch information
turt2live committed Sep 7, 2023
1 parent 0b73565 commit 17412db
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ require (
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/stretchr/testify v1.8.4
github.com/strukturag/libheif v1.16.2
github.com/t2bot/go-singleflight-streams v0.0.6
github.com/t2bot/go-singleflight-streams v0.0.7
github.com/t2bot/go-typed-singleflight v0.0.3
github.com/t2bot/gotd-contrib v0.0.0-20230907202504-d21987ea2957
github.com/t2bot/pgo-fleet/embedded v1.0.1
Expand Down
6 changes: 3 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGK
github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-redis/redis/v7 v7.4.0 h1:7obg6wUoj05T0EpY0o8B59S9w5yeMWql7sw2kwNW1x4=
github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg=
github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w=
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
github.com/go-redsync/redsync/v4 v4.8.2 h1:/b+jidlwOnSOl605hmNsd+ohfr/qB1EpLiKnCYkiw28=
github.com/go-redsync/redsync/v4 v4.8.2/go.mod h1:83QPGYHk0Wt2LhFo3n9xCrUGPQrQvejVTVR08KX032g=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
Expand Down Expand Up @@ -392,8 +392,8 @@ github.com/strukturag/libheif v1.16.2 h1:wCgk8RhYopsFsg73misRH7HLlKflrVBYyIcIcxd
github.com/strukturag/libheif v1.16.2/go.mod h1:E/PNRlmVtrtj9j2AvBZlrO4dsBDu6KfwDZn7X1Ce8Ks=
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203 h1:QVqDTf3h2WHt08YuiTGPZLls0Wq99X9bWd0Q5ZSBesM=
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203/go.mod h1:oqN97ltKNihBbwlX8dLpwxCl3+HnXKV/R0e+sRLd9C8=
github.com/t2bot/go-singleflight-streams v0.0.6 h1:vpTidNqVWzyJ3s2lCWU3U4ISMBkviRIOb7KrWv1e1SI=
github.com/t2bot/go-singleflight-streams v0.0.6/go.mod h1:pEIFm6l/utrXZBeP4tkIuMdYwBBN0TTw7feSEhozNzg=
github.com/t2bot/go-singleflight-streams v0.0.7 h1:IJriaUAF72b/ObD+tVEdzNB1M9VMx5w8ZoEb9LnXTsw=
github.com/t2bot/go-singleflight-streams v0.0.7/go.mod h1:pEIFm6l/utrXZBeP4tkIuMdYwBBN0TTw7feSEhozNzg=
github.com/t2bot/go-typed-singleflight v0.0.3 h1:TAQyjhfa5BA63BwFTEVY1a4NF07ekX9JRgite5Cbq0A=
github.com/t2bot/go-typed-singleflight v0.0.3/go.mod h1:0SOeDgjEtLYEy1InNhFBCgDx0UjKAqsLzk5MXek/JNw=
github.com/t2bot/gotd-contrib v0.0.0-20230907202504-d21987ea2957 h1:NEgOW/OCE0zGIiSxE+lW2KSqqqH4E1mTT3VGmpIz2U4=
Expand Down
4 changes: 4 additions & 0 deletions pipelines/pipeline_download/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import (
var streamSf = new(sfstreams.Group)
var recordSf = sfcache.NewSingleflightCache[*database.DbMedia]()

func init() {
streamSf.UseSeekers = true
}

type DownloadOpts struct {
FetchRemoteIfNeeded bool
BlockForReadUntil time.Duration
Expand Down
4 changes: 4 additions & 0 deletions pipelines/pipeline_thumbnail/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import (
var streamSf = new(sfstreams.Group)
var recordSf = sfcache.NewSingleflightCache[*database.DbThumbnail]()

func init() {
streamSf.UseSeekers = true
}

// ThumbnailOpts are options for generating a thumbnail
type ThumbnailOpts struct {
pipeline_download.DownloadOpts
Expand Down

0 comments on commit 17412db

Please sign in to comment.