Configuration
=============

.. _`configuration file`:

The service allowed two variant of configuration:

  #) use the Configurator service

  #) use the configuration file

The service reads settings from the configuration file by default.

You can specify the `--luna-config` option for pulling
settings from the Configurator service, see `configurator <configurator.html>`_.

Auto reload configuration
-------------------------

The service supports an auto-reload of configurations. You can enable this feature by specifying a `config-reload` option in the
command line. The service periodically checks new settings. If current settings and new pulled settings are the same the
service will not perform any actions. You can specify the check period in the `pulling-time` command line argument
(10 seconds by default).

If a configuration fetching has failed, the service will work without applying any changes to the existing configurations.

If check connections with the new configuration have failed, the service will retry pulling new configuration after `pulling-time` seconds.
The service will shut down after 10 failed attempts.

.. warning::
    Service can work incorrectly while the new settings are being applied. It is strongly recommended not to send requests to the service
    when you change important settings (database credentials, work plugins list, and others).

Configuration file for administrator
------------------------------------

.. literalinclude:: ../../../luna_streams/configs/config.conf

Extended administrator configuration
------------------------------------

.. automodule:: configs.config
	:members:
