I am working on a node project which I want to run it via node cluster. As I have some shared resources and configuration which can be used by each node cluster(Worker), At the start up I read these configuration and save it into redis db. In addition, in some other modules I need to query some external resource and fetch some data and save into redis db too(not at start up, when I need). For this reseaon, at the start up I put my configuration section into a function and call it if the cluster is Master(cluster.isMaster) :
if (cluster.isMaster)
configure();
my question is how can I do the same in other modules? in other modules I need to query external resource and put into redis just in master cluster, since after that it will be available for worker clusters too. So, no need to query in all clusters.
So thanks in advance,