Dont attempt to get size within archive process, will return empty; ref pterodactyl/panel#2420

The stat call is operating against an unflushed file if called in the archive function, so you'll just get the emtpy archive size, rather than the final size.

Plus, we only used the file stat in one place, so slight efficiency win?
This commit is contained in:
Dane Everitt
2020-09-27 11:16:38 -07:00
parent a0fa5a94b6
commit de30e2fcc9
5 changed files with 21 additions and 31 deletions

View File

@@ -33,7 +33,7 @@ func (s *S3Backup) Generate(included *IncludedFiles, prefix string) (*ArchiveDet
Files: included,
}
if _, err := a.Create(s.Path(), context.Background()); err != nil {
if err := a.Create(s.Path(), context.Background()); err != nil {
return nil, errors.WithStack(err)
}