1
0
Fork 0
mirror of https://github.com/benbusby/farside.git synced 2025-06-08 02:16:36 +00:00
farside/lib/farside/instances.ex

15 lines
410 B
Elixir

defmodule Farside.Instances do
alias Farside.LastUpdated
def sync() do
update_file = Application.fetch_env!(:farside, :update_file)
update_json = update_file <> ".json"
File.rename(update_json, "#{update_file}-#{to_string(DateTime.utc_now()) <> ".json"}")
File.write(update_json, "")
LastUpdated.value(DateTime.utc_now())
Farside.Instance.Supervisor.update_children()
end
end