fix: exception in standalone mode
This commit is contained in:
@@ -23,5 +23,6 @@ func init() {
|
||||
}
|
||||
|
||||
func runCommand(cmd *cobra.Command, args []string) {
|
||||
v2.Setup("./tmp", "./", "./tmp", 0, false)
|
||||
v2.RunStandalone(hiddifySettingPath, configPath, defaultConfigs)
|
||||
}
|
||||
|
||||
@@ -40,7 +40,9 @@ func (s *StorageService) Start() error {
|
||||
}
|
||||
|
||||
func (s *StorageService) Close() error {
|
||||
Storage.DB.Close()
|
||||
if Storage.DB != nil {
|
||||
Storage.DB.Close()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ func Register(service adapter.Service) {
|
||||
}
|
||||
|
||||
func StartServices() error {
|
||||
CloseServices()
|
||||
for _, service := range preservices {
|
||||
if err := service.Start(); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user