| 219 | } |
| 220 | |
| 221 | static int child_init(int rank) |
| 222 | { |
| 223 | struct cachedb_url *it; |
| 224 | cachedb_con *con; |
| 225 | |
| 226 | for (it = redis_script_urls;it;it=it->next) { |
| 227 | LM_DBG("iterating through conns - [%s]\n", db_url_escape(&it->url)); |
| 228 | con = redis_init(&it->url); |
| 229 | if (con == NULL) { |
| 230 | LM_ERR("failed to open connection\n"); |
| 231 | return -1; |
| 232 | } |
| 233 | if (cachedb_put_connection(&cache_mod_name,con) < 0) { |
| 234 | LM_ERR("failed to insert connection\n"); |
| 235 | return -1; |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | cachedb_free_url(redis_script_urls); |
| 240 | return 0; |
| 241 | } |
| 242 | |
| 243 | /* |
| 244 | * destroy function |
nothing calls this directly
no test coverage detected