mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 09:42:26 -05:00
[bugfix] Server and closer bugfixes (#839)
* defer streaming from storage more forcefully * shut down Server more gracefully * use command context as server BaseContext
This commit is contained in:
parent
c1585d5f8a
commit
3777f5c684
4 changed files with 47 additions and 29 deletions
|
|
@ -121,6 +121,12 @@ func (p *ProcessingEmoji) loadStatic(ctx context.Context) error {
|
|||
return p.err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err := stored.Close(); err != nil {
|
||||
log.Errorf("loadStatic: error closing stored full size: %s", err)
|
||||
}
|
||||
}()
|
||||
|
||||
// we haven't processed a static version of this emoji yet so do it now
|
||||
static, err := deriveStaticEmoji(stored, p.emoji.ImageContentType)
|
||||
if err != nil {
|
||||
|
|
@ -129,12 +135,6 @@ func (p *ProcessingEmoji) loadStatic(ctx context.Context) error {
|
|||
return p.err
|
||||
}
|
||||
|
||||
if err := stored.Close(); err != nil {
|
||||
p.err = fmt.Errorf("loadStatic: error closing stored full size: %s", err)
|
||||
atomic.StoreInt32(&p.staticState, int32(errored))
|
||||
return p.err
|
||||
}
|
||||
|
||||
// put the static in storage
|
||||
if err := p.storage.Put(ctx, p.emoji.ImageStaticPath, static.small); err != nil {
|
||||
p.err = fmt.Errorf("loadStatic: error storing static: %s", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue