File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
engine/internal/retrieval/engine/postgres/logical Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
1010 "bytes"
1111 "context"
1212 "fmt"
13+ "io/fs"
1314 "os"
1415 "path"
1516 "path/filepath"
@@ -165,7 +166,18 @@ func (r *RestoreJob) Reload(cfg map[string]interface{}) (err error) {
165166
166167 stat , err := os .Stat (r .RestoreOptions .DumpLocation )
167168 if err != nil {
168- return errors .Wrap (err , "dumpLocation not found" )
169+ if ! errors .Is (err , fs .ErrNotExist ) {
170+ return errors .Wrap (err , "cannot get stats of dumpLocation" )
171+ }
172+
173+ if err := os .MkdirAll (r .RestoreOptions .DumpLocation , 0666 ); err != nil {
174+ return fmt .Errorf ("error creating dumpLocation directory: %w" , err )
175+ }
176+
177+ stat , err = os .Stat (r .RestoreOptions .DumpLocation )
178+ if err != nil {
179+ return fmt .Errorf ("cannot get stats of dumpLocation: %w" , err )
180+ }
169181 }
170182
171183 r .isDumpLocationDir = stat .IsDir ()
You can’t perform that action at this time.
0 commit comments