2019-05-21 12:59:54 -06:00
|
|
|
defmodule FarmbotCore.Asset.Query do
|
2019-06-04 14:36:05 -06:00
|
|
|
@moduledoc """
|
|
|
|
Get data from the database
|
|
|
|
"""
|
|
|
|
|
2019-06-04 10:11:39 -06:00
|
|
|
alias FarmbotCore.Asset
|
|
|
|
|
2019-05-21 12:59:54 -06:00
|
|
|
@callback auto_sync?() :: boolean()
|
2019-06-04 14:36:05 -06:00
|
|
|
|
2019-11-07 11:07:27 -07:00
|
|
|
@callback first_sync?() :: boolean()
|
|
|
|
|
2019-06-04 14:36:05 -06:00
|
|
|
@doc "Returns the configuration value for auto_sync"
|
2019-05-21 12:59:54 -06:00
|
|
|
def auto_sync?() do
|
|
|
|
Asset.fbos_config().auto_sync
|
|
|
|
end
|
2019-11-07 11:07:27 -07:00
|
|
|
|
|
|
|
@doc "Checks if initial syncing is still required"
|
|
|
|
def first_sync?() do
|
|
|
|
is_nil(Asset.fbos_config().id)
|
|
|
|
end
|
2019-05-21 12:59:54 -06:00
|
|
|
end
|