Handler for things that need to wait until the cache is initialized.
| 813 | |
| 814 | // Handler for things that need to wait until the cache is initialized. |
| 815 | void |
| 816 | CB_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 | |
| 846 | void |
| 847 | CB_cmd_cache_clear() |
nothing calls this directly
no test coverage detected