File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,8 +116,12 @@ func App() *cli.App {
116116 return errors .Wrap (err , "creating temp mount location" )
117117 }
118118 // unmount all temp mounts on boot for the server
119- if err := mount .CleanupTempMounts (0 ); err != nil {
120- return errors .Wrap (err , "unmounting temp mounts" )
119+ warnings , err := mount .CleanupTempMounts (0 )
120+ if err != nil {
121+ log .G (ctx ).WithError (err ).Error ("unmounting temp mounts" )
122+ }
123+ for _ , w := range warnings {
124+ log .G (ctx ).WithError (w ).Warn ("cleanup temp mount" )
121125 }
122126 address := config .GRPC .Address
123127 if address == "" {
Original file line number Diff line number Diff line change @@ -39,10 +39,10 @@ func SetTempMountLocation(root string) error {
3939}
4040
4141// CleanupTempMounts all temp mounts and remove the directories
42- func CleanupTempMounts (flags int ) error {
42+ func CleanupTempMounts (flags int ) ( warnings [] error , err error ) {
4343 mounts , err := Self ()
4444 if err != nil {
45- return err
45+ return nil , err
4646 }
4747 var toUnmount []string
4848 for _ , m := range mounts {
@@ -53,11 +53,12 @@ func CleanupTempMounts(flags int) error {
5353 sort .Sort (sort .Reverse (sort .StringSlice (toUnmount )))
5454 for _ , path := range toUnmount {
5555 if err := UnmountAll (path , flags ); err != nil {
56- return err
56+ warnings = append (warnings , err )
57+ continue
5758 }
5859 if err := os .Remove (path ); err != nil {
59- return err
60+ warnings = append ( warnings , err )
6061 }
6162 }
62- return nil
63+ return warnings , nil
6364}
Original file line number Diff line number Diff line change @@ -24,6 +24,6 @@ func SetTempMountLocation(root string) error {
2424}
2525
2626// CleanupTempMounts all temp mounts and remove the directories
27- func CleanupTempMounts (flags int ) error {
28- return nil
27+ func CleanupTempMounts (flags int ) ([] error , error ) {
28+ return nil , nil
2929}
You can’t perform that action at this time.
0 commit comments