From ce8c0f1d6b42f2bdccc81ab5d939100bae4b1133 Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 1 Nov 2012 13:49:25 +0000 Subject: - dbs are now periodically flushed on disc every 5 minutes git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/trunk@1625 82007160-df01-0410-b94d-b575c5fd34c7 --- src/conf_db.c | 10 ++++++++++ src/ircd.c | 2 ++ src/resv.c | 6 ------ 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/conf_db.c b/src/conf_db.c index a888b56..115b1d5 100644 --- a/src/conf_db.c +++ b/src/conf_db.c @@ -1073,3 +1073,13 @@ load_xline_database(void) close_db(f); } + +void +save_all_databases(void *unused) +{ + save_kline_database(); + save_dline_database(); + save_gline_database(); + save_xline_database(); + save_resv_database(); +} diff --git a/src/ircd.c b/src/ircd.c index 977841d..75b10ed 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -651,6 +651,8 @@ main(int argc, char *argv[]) /* Setup the timeout check. I'll shift it later :) -- adrian */ eventAddIsh("comm_checktimeouts", comm_checktimeouts, NULL, 1); + eventAddIsh("save_all_databases", save_all_databases, NULL, DATABASE_UPDATE_TIMEOUT); + if (ConfigServerHide.links_delay > 0) eventAddIsh("write_links_file", write_links_file, NULL, ConfigServerHide.links_delay); else diff --git a/src/resv.c b/src/resv.c index 21d56b0..6f5130b 100644 --- a/src/resv.c +++ b/src/resv.c @@ -73,9 +73,6 @@ create_channel_resv(char *name, char *reason, int in_conf) dlinkAdd(resv_p, &resv_p->node, &resv_channel_list); hash_add_resv(resv_p); - if (!in_conf) - save_resv_database(); - return conf; } @@ -109,9 +106,6 @@ create_nick_resv(char *name, char *reason, int in_conf) DupString(resv_p->reason, reason); resv_p->action = in_conf; - if (!in_conf) - save_resv_database(); - return conf; } -- cgit