Improve storage driver termination

This commit is contained in:
Lukas SP 2020-08-24 18:08:27 +02:00
parent eec83518ad
commit 27284a0b3a
2 changed files with 8 additions and 2 deletions

View File

@ -18,7 +18,13 @@ func main() {
if err != nil {
panic(err)
}
defer storage.Current.Terminate()
defer func() {
log.Println("Terminating the storage driver...")
err := storage.Current.Terminate()
if err != nil {
log.Fatalln(err)
}
}()
// Serve the web resources
log.Println("Serving the web resources...")

View File

@ -33,7 +33,7 @@ func (driver *S3Driver) Initialize() error {
return nil
}
// Terminate terminates the AWS S3 storage driver
// Terminate terminates the AWS S3 storage driver (does nothing, because the AWS S3 storage driver does not need any termination)
func (driver *S3Driver) Terminate() error {
return nil
}