How to access TenantConfigs

#1

If you want to access a TenantConfig value be sure to use one of the config* apis instead of getValue or explicitly doing a fetch on TenantConfig. The values for TenantConfig is cached and can help save a lot of unnecessary io. There is already mechanism in place to refresh the cache on data change to that type.
E.g.

use:
TenantConfig.configStr("Normalize")

instead of:
TenantConfig.make("Normalize").get() or TenantConfig.getValue("Normalize")
4 Likes
#2

One of the things we found is that if you change the value of the entry in TenantConfig and then run your script / program / routine, using TenantCong.configStr, it picks up the cached value instead of the new value.

you mention that there is a mechanism to refresh the cache. How can we force the cache to be refreshed so that the new value is picked up immediately?

1 Like
#3

When you update the entry in TenantConfig or any cached backed type, the cache invalidation is undertaken by the platform, and the refresh automatically occurs, and the new value will be available in the cache if you use the correct methods like configStr.