From c753bfe0f8c1593870716bef90a5a097c494265f Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Wed, 24 Nov 2010 11:48:09 +0200 Subject: [PATCH] pgqd: report database removal --- sql/ticker/pgqd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sql/ticker/pgqd.c b/sql/ticker/pgqd.c index 84885383..aad7454e 100644 --- a/sql/ticker/pgqd.c +++ b/sql/ticker/pgqd.c @@ -169,8 +169,10 @@ static void launch_db(const char *dbname) launch_ticker(db); } -static void drop_db(struct PgDatabase *db) +static void drop_db(struct PgDatabase *db, bool log) { + if (log) + log_info("Unregister database: %s", db->name); statlist_remove(&database_list, &db->head); pgs_free(db->c_ticker); pgs_free(db->c_maint); @@ -207,7 +209,7 @@ static void detect_handler(struct PgSocket *sk, void *arg, enum PgEvent ev, PGre statlist_for_each_safe(el, &database_list, tmp) { db = container_of(el, struct PgDatabase, head); if (db->dropped) - drop_db(db); + drop_db(db, true); } pgs_disconnect(sk); pgs_sleep(sk, cf.check_period); @@ -255,7 +257,7 @@ static void recheck_dbs(void) statlist_for_each_safe(el, &database_list, tmp) { db = container_of(el, struct PgDatabase, head); if (db->dropped) - drop_db(db); + drop_db(db, true); } /* done with template for the moment */ @@ -298,7 +300,7 @@ static void cleanup(void) statlist_for_each_safe(elem, &database_list, tmp) { db = container_of(elem, struct PgDatabase, head); - drop_db(db); + drop_db(db, false); } pgs_free(db_template); -- 2.39.5