mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 10:35:01 +00:00
fix: security scanner warning noise: error handlers part 2 (#2145)
check off a few more error handlers Signed-off-by: Dave Lee <dave@gray101.com>
This commit is contained in:
parent
b7ea9602f5
commit
11c48a0004
11 changed files with 82 additions and 24 deletions
|
@ -31,8 +31,14 @@ func newConfigFileHandler(appConfig *config.ApplicationConfig) configFileHandler
|
|||
handlers: make(map[string]fileHandler),
|
||||
appConfig: appConfig,
|
||||
}
|
||||
c.Register("api_keys.json", readApiKeysJson(*appConfig), true)
|
||||
c.Register("external_backends.json", readExternalBackendsJson(*appConfig), true)
|
||||
err := c.Register("api_keys.json", readApiKeysJson(*appConfig), true)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("file", "api_keys.json").Msg("unable to register config file handler")
|
||||
}
|
||||
err = c.Register("external_backends.json", readExternalBackendsJson(*appConfig), true)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("file", "external_backends.json").Msg("unable to register config file handler")
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -118,8 +124,8 @@ func (c *configFileHandler) Watch() error {
|
|||
}
|
||||
|
||||
// TODO: When we institute graceful shutdown, this should be called
|
||||
func (c *configFileHandler) Stop() {
|
||||
c.watcher.Close()
|
||||
func (c *configFileHandler) Stop() error {
|
||||
return c.watcher.Close()
|
||||
}
|
||||
|
||||
func readApiKeysJson(startupAppConfig config.ApplicationConfig) fileHandler {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue