static async set(key, value, type = null) {

        let bean = await R.findOne("setting", " `key` = ? ", [
            key,
        ]);
        if (!bean) {
            bean = R.dispense("setting");
            bean.key = key;
        }
        bean.type = type;
        bean.value = JSON.stringify(value);
        await R.store(bean);

        Settings.deleteCache([ key ]);
    }
Sets the specified setting to specified value
@param {string} key Key of setting to set
@param {any} value Value to set to
@param {?string} type Type of setting
@returns {Promise<void>}