mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix(cache): index dir
This commit is contained in:
parent
45e0a73aa8
commit
f31407dd7e
1 changed files with 10 additions and 5 deletions
15
internal/cache/index.go
vendored
15
internal/cache/index.go
vendored
|
@ -50,6 +50,11 @@ func init() {
|
||||||
|
|
||||||
// InitScanner initializes the config scanner
|
// InitScanner initializes the config scanner
|
||||||
func InitScanner() {
|
func InitScanner() {
|
||||||
|
if nginx.GetConfPath() == "" {
|
||||||
|
logger.Error("Nginx config path is not set")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
s := GetScanner()
|
s := GetScanner()
|
||||||
err := s.Initialize()
|
err := s.Initialize()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -154,11 +159,11 @@ func (s *Scanner) Initialize() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup watcher for config directory
|
// Setup watcher for config directory
|
||||||
configDir := filepath.Dir(nginx.GetConfPath("", ""))
|
configDir := filepath.Dir(nginx.GetConfPath())
|
||||||
availableDir := nginx.GetConfPath("sites-available", "")
|
availableDir := nginx.GetConfPath("sites-available")
|
||||||
enabledDir := nginx.GetConfPath("sites-enabled", "")
|
enabledDir := nginx.GetConfPath("sites-enabled")
|
||||||
streamAvailableDir := nginx.GetConfPath("stream-available", "")
|
streamAvailableDir := nginx.GetConfPath("stream-available")
|
||||||
streamEnabledDir := nginx.GetConfPath("stream-enabled", "")
|
streamEnabledDir := nginx.GetConfPath("stream-enabled")
|
||||||
|
|
||||||
// Watch the main directories
|
// Watch the main directories
|
||||||
err = s.watcher.Add(configDir)
|
err = s.watcher.Add(configDir)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue