From 0dac2dbc49bf13cb42bdac84fd1780d0ba63f4aa Mon Sep 17 00:00:00 2001 From: rburchell Date: Mon, 26 Jan 2009 20:07:28 +0000 Subject: [PATCH] Check noexpire/readonly in expire_all(), not the mainloop. Otherwise, expiry will happen on shutdown. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1935 5417fbe8-f217-4b02-8779-1006273d7864 --- src/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 2ec387196..30cbbdc11 100644 --- a/src/main.c +++ b/src/main.c @@ -100,6 +100,12 @@ static int started = 0; extern void expire_all() { + if (noexpire || readonly) + { + // Definitely *do not* want. + return; + } + waiting = -30; send_event(EVENT_DB_EXPIRE, 1, EVENT_START); waiting = -3; @@ -542,8 +548,9 @@ int main(int ac, char **av, char **envp) if (debug >= 2) alog("debug: Top of main loop"); - if (!noexpire && !readonly - && (save_data || t - last_expire >= ExpireTimeout)) { + // Never fear. noexpire/readonly are checked in expire_all(). + if (save_data || t - last_expire >= ExpireTimeout) + { expire_all(); last_expire = t; }