fix: handle FileSystem :ignore in ProfileWatcher for CI
This commit is contained in:
parent
6ad7f7233d
commit
1987d84637
1 changed files with 10 additions and 5 deletions
|
|
@ -29,12 +29,17 @@ defmodule Towerops.Profiles.ProfileWatcher do
|
|||
profiles_path = Path.join(Application.app_dir(:towerops), @profiles_dir)
|
||||
|
||||
# Start watching the profiles directory for changes (using apply to avoid compile-time warnings)
|
||||
{:ok, watcher_pid} = apply(FileSystem, :start_link, [[dirs: [profiles_path]]])
|
||||
apply(FileSystem, :subscribe, [watcher_pid])
|
||||
case apply(FileSystem, :start_link, [[dirs: [profiles_path]]]) do
|
||||
{:ok, watcher_pid} ->
|
||||
apply(FileSystem, :subscribe, [watcher_pid])
|
||||
Logger.info("ProfileWatcher: Started watching #{profiles_path}")
|
||||
{:ok, %{watcher_pid: watcher_pid, profiles_path: profiles_path}}
|
||||
|
||||
Logger.info("ProfileWatcher: Started watching #{profiles_path}")
|
||||
|
||||
{:ok, %{watcher_pid: watcher_pid, profiles_path: profiles_path}}
|
||||
:ignore ->
|
||||
# inotify-tools not available (e.g., in CI)
|
||||
Logger.debug("ProfileWatcher: FileSystem watcher not available, running in no-op mode")
|
||||
{:ok, %{}}
|
||||
end
|
||||
else
|
||||
# In production, FileSystem is not available
|
||||
Logger.debug("ProfileWatcher: FileSystem not available, running in no-op mode (dev-only feature)")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue