Implement config notification event

Add fieldChanged event to config objects that is triggered when the
value of a field in a group belonging to it is changed.
This commit is contained in:
Hornwitser committed 2020-05-30 14:27:59 +02:00
1 parent fc3686b865
commit 67ca8dcc4d
4 files changed
+101 -21

No files matched your search

+13
View File
@@ -42,6 +42,19 @@ class BaseInstancePlugin {
*/
async init() { }
/**
* Called when the value of a config field changed.
*
* Invoked after the value of the config field given by `field` has
* changed.
*
* @param {module:lib/config.ConfigGroup} group -
* The group who's field got changed on.
* @param {string} field - Name of the field that changed.
* @param prev - The previous value of the field.
*/
async onInstanceConfigFieldChanged(group, field, prev) { }
/**
* Called before collecting Prometheus metrics
*