lib/core: use config for flush frequency