Make sure to index all farmware on bootup
This commit is contained in:
parent
0ede73849e
commit
601b3e2585
|
@ -322,6 +322,7 @@ defmodule Farmbot.BotState do
|
|||
meta: ser_fw_meta,
|
||||
name: fw.name,
|
||||
path: Farmbot.Farmware.Installer.install_path(fw),
|
||||
config: fw.config,
|
||||
url: fw.url
|
||||
}
|
||||
new_pi = Map.put(state.process_info.farmwares, fw.name, ser_fw)
|
||||
|
|
|
@ -31,6 +31,13 @@ defmodule Farmbot.Farmware.Installer.Repository.SyncTask do
|
|||
Installer.sync_repo(repo)
|
||||
end
|
||||
|
||||
all_fws = File.ls!(Installer.install_root_path)
|
||||
for fw_name <- all_fws do
|
||||
case Farmbot.Farmware.lookup(fw_name) do
|
||||
{:ok, %Farmbot.Farmware{} = farmware} -> Farmbot.BotState.register_farmware(farmware)
|
||||
_ -> :ok
|
||||
end
|
||||
end
|
||||
:ok
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue