fix rename failed when rewrite public keys (#7761) (#7769)

pull/7777/head
Lunny Xiao 6 years ago committed by GitHub
parent 1b5908fb6a
commit aea49d0b92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      models/ssh_key.go

@ -642,12 +642,14 @@ func rewriteAllPublicKeys(e Engine) error {
}
_, err = t.WriteString(line + "\n")
if err != nil {
f.Close()
return err
}
}
defer f.Close()
f.Close()
}
t.Close()
return os.Rename(tmpPath, fPath)
}

Loading…
Cancel
Save