Skip to content

Commit

Permalink
cachedb_mongodb: Add connection cleanup at shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Mar 9, 2017
1 parent 4e8ab44 commit 8aa8fd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/cachedb_mongodb/cachedb_mongodb.c
Expand Up @@ -183,6 +183,7 @@ static int child_init(int rank)
static void destroy(void)
{
LM_NOTICE("destroy module cachedb_mongodb ...\n");

cachedb_end_connections(&cache_mod_name);
return;
mongoc_cleanup();
}
4 changes: 4 additions & 0 deletions modules/cachedb_mongodb/cachedb_mongodb_dbase.c
Expand Up @@ -144,6 +144,10 @@ cachedb_con *mongo_con_init(str *url)

void mongo_free_connection(cachedb_pool_con *con)
{
mongo_con *mcon = (mongo_con *)con;

mongoc_collection_destroy(mcon->collection);
mongoc_client_destroy(mcon->client);
}

void mongo_con_destroy(cachedb_con *con)
Expand Down

0 comments on commit 8aa8fd6

Please sign in to comment.