| 38 | |
| 39 | |
| 40 | int ul_init_timers(void) |
| 41 | { |
| 42 | /* cache -> DB timer */ |
| 43 | if (register_timer("ul-timer", synchronize_all_udomains, 0, timer_interval, |
| 44 | TIMER_FLAG_DELAY_ON_DELAY) < 0) { |
| 45 | LM_ERR("oom\n"); |
| 46 | return -1; |
| 47 | } |
| 48 | |
| 49 | pending_refreshes = shm_malloc(sizeof *pending_refreshes); |
| 50 | if (!pending_refreshes) { |
| 51 | LM_ERR("oom\n"); |
| 52 | return -1; |
| 53 | } |
| 54 | |
| 55 | if (!(ul_refresh_lock = lock_alloc())) { |
| 56 | LM_ERR("oom\n"); |
| 57 | return -1; |
| 58 | } |
| 59 | |
| 60 | INIT_LIST_HEAD(pending_refreshes); |
| 61 | lock_init(ul_refresh_lock); |
| 62 | |
| 63 | /* contact refresh event timer */ |
| 64 | if (ct_refresh_timer && |
| 65 | register_timer("ul-refresh-timer", trigger_ct_refreshes, 0, |
| 66 | 1, TIMER_FLAG_SKIP_ON_DELAY) < 0) { |
| 67 | LM_ERR("oom\n"); |
| 68 | return -1; |
| 69 | } |
| 70 | |
| 71 | return 0; |
| 72 | } |
| 73 | |
| 74 | |
| 75 | /*! \brief |
no test coverage detected