Skip to content

Commit

Permalink
Reverting experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
benpate committed Jan 20, 2025
1 parent 4de1e85 commit 281e7a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions domain/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ package domain

import (
"context"
"os"
"strings"
"time"

"github.com/EmissarySocial/emissary/build"
"github.com/EmissarySocial/emissary/config"
Expand Down Expand Up @@ -687,10 +685,11 @@ func (factory *Factory) StreamUpdateChannel() chan primitive.ObjectID {
func (factory *Factory) MediaServer() mediaserver.MediaServer {

// Wrap the remote cache in a local filesystem cache.
tempFS := afero.NewBasePathFs(afero.NewOsFs(), os.TempDir())
cacheFS := afero.NewCacheOnReadFs(factory.AttachmentCache(), tempFS, 10*time.Minute)
// tempFS := afero.NewBasePathFs(afero.NewOsFs(), os.TempDir())
// cacheFS := afero.NewCacheOnReadFs(factory.AttachmentCache(), tempFS, 10*time.Minute)
// return mediaserver.New(factory.AttachmentOriginals(), cacheFS)

return mediaserver.New(factory.AttachmentOriginals(), cacheFS)
return mediaserver.New(factory.AttachmentOriginals(), factory.AttachmentCache())
}

// AttachmentOriginals returns a reference to the Filesystem where original attachment files are stored
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/benpate/hannibal v0.11.25
github.com/benpate/html v0.16.11
github.com/benpate/icon v0.4.0
github.com/benpate/mediaserver v0.14.0
github.com/benpate/mediaserver v0.14.1
github.com/benpate/re v0.3.1
github.com/benpate/remote v0.17.1
github.com/benpate/rosetta v0.24.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ github.com/benpate/html v0.16.11 h1:4SNzQdgVSHr6FfV95e7Ek3ELdqLZoyzCpUSd91KmwBA=
github.com/benpate/html v0.16.11/go.mod h1:ET6LJ0RPp0WYnvIMctZGNbHMGylobGO7i7SWROKC5eE=
github.com/benpate/icon v0.4.0 h1:HWOMaYwxPsLb3OPX02+j05FwCq376rcAfeGG1kfDXyc=
github.com/benpate/icon v0.4.0/go.mod h1:JL7rWluHtCL11byJ/5mfJdpql/Wx8w0A+gXge83MmA4=
github.com/benpate/mediaserver v0.14.0 h1:zuYdG/12289nWx0keaC2oIaCehiWIYSHquDUaxftGh4=
github.com/benpate/mediaserver v0.14.0/go.mod h1:2eB/0UMVb9uGe5t2Nz359R83IZCJRksAtBXizEVr1YM=
github.com/benpate/mediaserver v0.14.1 h1:R6os801B0/GgQINkDsYxO+2ToaTKylNz8JzAagaxMlM=
github.com/benpate/mediaserver v0.14.1/go.mod h1:2eB/0UMVb9uGe5t2Nz359R83IZCJRksAtBXizEVr1YM=
github.com/benpate/re v0.3.1 h1:lslTuVnhqc3f0BTuOFZwcOztjRRr9U9RxPOfwZ+41Zk=
github.com/benpate/re v0.3.1/go.mod h1:ifBw3C5csNXrciDF+j6XdRJTiUrMHbKk9/MjM07dMcM=
github.com/benpate/remote v0.17.1 h1:/VSyXL2QaTh03ItOeszHM5ea1mSoNzBUe4xwCXRHf5Y=
Expand Down

0 comments on commit 281e7a6

Please sign in to comment.