Continuer exécution de serverCmd même sans db
Remplacer log.Fatal par log.Printf si serverCmd ne rejoint pas la db. Autres changements: - Clarifier messages d'erreur du *media.MediaClient de serverCmd - Seulement seed si mediaClient est valide (should always be mais bon)
This commit is contained in:
parent
b2465d2324
commit
76762026f3
1 changed files with 10 additions and 9 deletions
|
@ -48,16 +48,17 @@ var serverCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
mediaClient, err := media.NewMediaClientFromViper()
|
mediaClient, err := media.NewMediaClientFromViper()
|
||||||
if err != nil {
|
switch err != nil {
|
||||||
log.Fatal(err)
|
case true:
|
||||||
}
|
log.Printf("media.NewMediaClientFromViper error: %s", err)
|
||||||
|
case false:
|
||||||
new_buckets, err := mediaClient.Seed()
|
new_buckets, err := mediaClient.Seed()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Printf("(*media.MediaClient).Seed error: %s", err)
|
||||||
}
|
} else {
|
||||||
|
|
||||||
log.Printf("Seeded %d buckets.\n", len(new_buckets))
|
log.Printf("Seeded %d buckets.\n", len(new_buckets))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RunServer()
|
RunServer()
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue