File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 88language : go
99
1010go :
11- - 1.5.2
11+ - 1.8.3
1212
1313env :
1414 - TEST_VERBOSE=1
Original file line number Diff line number Diff line change @@ -53,9 +53,10 @@ func (m Migration) Apply(opts migrate.Options) error {
5353 basepath := filepath .Join (opts .Path , "blocks" )
5454 ffspath := filepath .Join (opts .Path , "blocks-v4" )
5555 if err := os .Rename (basepath , ffspath ); err != nil {
56- if os .IsNotExist (err ) {
57- fi , err2 := os .Stat (ffspath )
58- if err2 == nil && fi .IsDir () {
56+ // the error returned is unreliable so instead check that the
57+ // old path doesn't exist and the new one does and is a directory
58+ if _ , err2 := os .Stat (basepath ); os .IsNotExist (err2 ) {
59+ if fi , err2 := os .Stat (ffspath ); err2 == nil && fi .IsDir () {
5960 log .Log ("... blocks already renamed to blocks-v4, continuing" )
6061 err = nil
6162 }
You can’t perform that action at this time.
0 commit comments