/*! \brief * Timer handler */ static void timer(unsigned int ticks, void* param) { if (sync_lock) lock_start_read(sync_lock); if (synchronize_all_udomains() != 0) { LM_ERR("synchronizing cache failed\n"); } if (sync_lock) lock_stop_read(sync_lock); }
/*! \brief * Timer handler */ static void timer(unsigned int ticks, void* param) { LM_DBG("Syncing cache\n"); if (usrloc_debug) { print_all_udomains(debug_file); fflush(debug_file); } if (synchronize_all_udomains() != 0) { LM_ERR("synchronizing cache failed\n"); } }
/*! * \brief Flush the usrloc memory cache to DB * \param cmd mi_root containing the parameter * \param param not used * \return mi_root with the result or 0 on failure */ struct mi_root* mi_usrloc_flush(struct mi_root *cmd, void *param) { struct mi_root *rpl_tree; rpl_tree = init_mi_tree( 200, MI_OK_S, MI_OK_LEN); if (rpl_tree==NULL) return 0; synchronize_all_udomains(0, 1); return rpl_tree; }
/* * Timer handler */ static void timer(unsigned int ticks, void* param) { #ifdef EXTRA_DEBUG DBG("Running timer\n"); #endif if (synchronize_all_udomains() != 0) { LOG(L_ERR, "timer(): Error while synchronizing cache\n"); } #ifdef EXTRA_DEBUG DBG("Timer done\n"); #endif }
/* * Module destroy function */ static void destroy(void) { /* Parent only, synchronize the world * and then nuke it */ if (is_main) { if (synchronize_all_udomains() != 0) { LOG(L_ERR, "timer(): Error while flushing cache\n"); } free_all_udomains(); } /* All processes close database connection */ if (db) db_close(db); }
/*! \brief * Module destroy function */ static void destroy(void) { /* we need to sync DB in order to flush the cache */ if (ul_dbh) { ul_unlock_locks(); if (synchronize_all_udomains(0, 1) != 0) { LM_ERR("flushing cache failed\n"); } ul_dbf.close(ul_dbh); } free_all_udomains(); ul_destroy_locks(); /* free callbacks list */ destroy_ulcb_list(); }
/*! \brief * Module destroy function */ static void destroy(void) { if (sub_dialog_table) { pres_destroy_shtable(sub_dialog_table, sub_dialog_hash_size); } if (ul_dbh) { ul_unlock_locks(); if (synchronize_all_udomains(0, 1) != 0) { LM_ERR("flushing cache failed\n"); } ul_dbf.close(ul_dbh); } free_all_udomains(); ul_destroy_locks(); subs_destroy_locks(); destroy_contacts_locks(); /* free callbacks list */ destroy_ulcb_list(); }
static void rpc_flush(rpc_t* rpc, void* c) { synchronize_all_udomains(); }
/*! \brief * Local timer handler */ static void ul_local_timer(unsigned int ticks, void* param) { if (synchronize_all_udomains((int)(long)param, ul_timer_procs) != 0) { LM_ERR("synchronizing cache failed\n"); } }
/*! \brief * Core timer handler */ static void ul_core_timer(unsigned int ticks, void* param) { if (synchronize_all_udomains(0, 1) != 0) { LM_ERR("synchronizing cache failed\n"); } }
int static ul_flush(FILE* pipe, char* response_file) { synchronize_all_udomains(); fifo_reply(response_file, "200 ul_flush completed" ); return 1; }