MCPcopy Create free account
hub / github.com/apache/trafficserver / CB_After_Cache_Init

Function CB_After_Cache_Init

src/traffic_server/traffic_server.cc:815–844  ·  view source on GitHub ↗

Handler for things that need to wait until the cache is initialized.

Source from the content-addressed store, hash-verified

813
814// Handler for things that need to wait until the cache is initialized.
815void
816CB_After_Cache_Init()
817{
818 APIHook *hook;
819 int start;
820
821 start = ink_atomic_swap(&delay_listen_for_cache, -1);
822 emit_fully_initialized_message();
823
824 if (1 == start) {
825 // The delay_listen_for_cache value was 1, therefore the main function
826 // delayed the call to start_HttpProxyServer until we got here. We must
827 // call accept on the ports now that the cache is initialized.
828 Note("Enabling listen, cache initialization finished");
829 start_HttpProxyServer();
830 emit_fully_initialized_message();
831 }
832
833 ts::Metrics &metrics = ts::Metrics::instance();
834 auto id = metrics.lookup("proxy.process.proxy.cache_ready_time");
835
836 metrics[id].store(time(nullptr));
837
838 // Alert the plugins the cache is initialized.
839 hook = g_lifecycle_hooks->get(TS_LIFECYCLE_CACHE_READY_HOOK);
840 while (hook) {
841 hook->invoke(TS_EVENT_LIFECYCLE_CACHE_READY, nullptr);
842 hook = hook->next();
843 }
844}
845
846void
847CB_cmd_cache_clear()

Callers

nothing calls this directly

Calls 8

ink_atomic_swapFunction · 0.85
start_HttpProxyServerFunction · 0.85
lookupMethod · 0.45
storeMethod · 0.45
getMethod · 0.45
invokeMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected