MCPcopy Index your code
hub / github.com/chartbrew/chartbrew / runSingleFlight

Method runSingleFlight

server/modules/runtimeCache.js:780–793  ·  view source on GitHub ↗
(key, factory)

Source from the content-addressed store, hash-verified

778 }
779
780 runSingleFlight(key, factory) {
781 if (this.inFlight.has(key)) {
782 return this.inFlight.get(key);
783 }
784
785 const promise = Promise.resolve()
786 .then(factory)
787 .finally(() => {
788 this.inFlight.delete(key);
789 });
790
791 this.inFlight.set(key, promise);
792 return promise;
793 }
794
795 triggerBackgroundRefresh(key, factory) {
796 if (this.inFlight.has(key)) {

Callers 2

updateChartDataMethod · 0.80

Calls 3

getMethod · 0.45
deleteMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected