# `Lightning.Adaptors.Config`
[🔗](https://github.com/OpenFn/lightning/blob/main/lib/lightning/adaptors/config.ex#L1)

Runtime configuration for the adaptors subsystem, read from
`config :lightning, Lightning.Adaptors` on every call.

Strategy-specific options live under the strategy module's own key;
see `strategy_opts/1`.

# `cache_timeout_ms`

```elixir
@spec cache_timeout_ms() :: non_neg_integer()
```

How long a read waits for a cache fill, in milliseconds. Defaults to
15 seconds.

# `default_instance`

```elixir
@spec default_instance() :: atom()
```

The supervisor instance public `Lightning.Adaptors` functions read
through when called with no explicit instance. Defaults to
`Lightning.Adaptors`, the one started in `application.ex`.

Tests stub this to isolate reads to a private instance; see
`Lightning.AdaptorTestHelpers.isolated_adaptors/1`.

# `first_load_timeout`

```elixir
@spec first_load_timeout() :: non_neg_integer()
```

Bound, in milliseconds, on how long `Lightning.Adaptors.ensure_loaded/1`
and `Lightning.Adaptors.fetch_adaptor/2` block waiting for the
catalogue's first load. Defaults to 90 seconds.

# `icon_path`

```elixir
@spec icon_path() :: Path.t()
```

Filesystem path of the icon cache. A `{:tmp, suffix}` value is joined
to `System.tmp_dir!/0` at call time; a binary is returned as is.
Defaults to `{:tmp, "lightning/adaptor_icons"}`.

# `refresh_interval`

```elixir
@spec refresh_interval() :: non_neg_integer()
```

Scheduler tick interval in milliseconds. Defaults to one hour.

# `source_for`

```elixir
@spec source_for(module()) :: :local | :npm
```

The catalogue `source` a strategy writes under.

`Lightning.Adaptors.Local` and `Lightning.Adaptors.NPM` are mapped
here; any other strategy must declare a `:source` of `:npm` or
`:local` under its own application key, or this raises rather than
guessing at `:npm`.

# `strategy`

```elixir
@spec strategy() :: module()
```

The active strategy module. Defaults to `Lightning.Adaptors.NPM`.

# `strategy_opts`

```elixir
@spec strategy_opts(module()) :: keyword()
```

Options configured under the strategy module's own application key, or
`[]` when unset.

# `warn_when_empty?`

```elixir
@spec warn_when_empty?() :: boolean()
```

Whether a scheduler booting on an empty catalogue that no timer will
fill should warn an operator. Defaults to true. Read once by
`Lightning.Adaptors.Supervisor` at boot and passed to the scheduler.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
