mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-07 15:52:47 +01:00
Improve restore
This commit is contained in:
3
auth.go
3
auth.go
@@ -30,7 +30,8 @@ func (c *catalystResolver) UserCreateIfNotExists(ctx context.Context, user *maut
|
|||||||
}
|
}
|
||||||
|
|
||||||
if user == nil || user.APIKey {
|
if user == nil || user.APIKey {
|
||||||
_, err = c.database.UserCreateSetupAPIKey(ctx, password)
|
// ignore error, because we don't care if the user already exists
|
||||||
|
_, _ = c.database.UserCreateSetupAPIKey(ctx, password)
|
||||||
} else {
|
} else {
|
||||||
_, err = c.database.UserCreate(ctx, &model.UserForm{
|
_, err = c.database.UserCreate(ctx, &model.UserForm{
|
||||||
Apikey: user.APIKey,
|
Apikey: user.APIKey,
|
||||||
|
|||||||
@@ -83,7 +83,8 @@ func restoreS3(catalystStorage *storage.Storage, p string) error {
|
|||||||
|
|
||||||
entries, err := fs.ReadDir(minioDir, ".")
|
entries, err := fs.ReadDir(minioDir, ".")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
// directory might not exist
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
|
|||||||
Reference in New Issue
Block a user