Permettre exécution sans base de donnée #152

Merged
vlbeaudoin merged 2 commits from change/allow-running-without-db into main 2023-10-05 15:32:37 -04:00
Showing only changes of commit 76762026f3 - Show all commits

View file

@ -48,17 +48,18 @@ var serverCmd = &cobra.Command{
}
mediaClient, err := media.NewMediaClientFromViper()
if err != nil {
log.Fatal(err)
switch err != nil {
case true:
log.Printf("media.NewMediaClientFromViper error: %s", err)
case false:
new_buckets, err := mediaClient.Seed()
if err != nil {
log.Printf("(*media.MediaClient).Seed error: %s", err)
} else {
log.Printf("Seeded %d buckets.\n", len(new_buckets))
}
}
new_buckets, err := mediaClient.Seed()
if err != nil {
log.Fatal(err)
}
log.Printf("Seeded %d buckets.\n", len(new_buckets))
RunServer()
},
}