summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-11-11 09:28:49 -0500
committerAdam <Adam@anope.org>2016-11-11 09:29:45 -0500
commit90e9dbca82fe1db77616ba669e2aa96c0b47ca54 (patch)
tree612c0677a9278072ae163c9631187855bd91b1f5
parentbe17c8118762c7c928239a026359e4fa0fd36f00 (diff)
Remove database save and related commands/config
-rw-r--r--data/anope.example.conf5
-rw-r--r--data/operserv.example.conf15
-rw-r--r--include/anope.h4
-rw-r--r--include/event.h11
-rw-r--r--modules/operserv/shutdown.cpp41
-rw-r--r--modules/operserv/update.cpp56
-rw-r--r--src/init.cpp3
-rw-r--r--src/main.cpp21
8 files changed, 9 insertions, 147 deletions
diff --git a/data/anope.example.conf b/data/anope.example.conf
index 29b8e2481..408120c37 100644
--- a/data/anope.example.conf
+++ b/data/anope.example.conf
@@ -430,11 +430,6 @@ options
badpasstimeout = 1h
/*
- * Sets the delay between automatic database updates.
- */
- updatetimeout = 5m
-
- /*
* Sets the delay between checks for expired nicknames and channels.
*/
expiretimeout = 30m
diff --git a/data/operserv.example.conf b/data/operserv.example.conf
index c2ec7e250..0e0e59592 100644
--- a/data/operserv.example.conf
+++ b/data/operserv.example.conf
@@ -627,12 +627,11 @@ command { service = "OperServ"; name = "SET"; command = "operserv/set"; permissi
/*
* operserv/shutdown
*
- * Provides the commands operserv/quit, operserv/restart, and operserv/shutdown.
+ * Provides the commands operserv/restart and operserv/shutdown.
*
- * Used to quit, restart, or shutdown services.
+ * Used to restart or shutdown services.
*/
module { name = "operserv/shutdown" }
-command { service = "OperServ"; name = "QUIT"; command = "operserv/quit"; permission = "operserv/quit"; }
command { service = "OperServ"; name = "RESTART"; command = "operserv/restart"; permission = "operserv/restart"; }
command { service = "OperServ"; name = "SHUTDOWN"; command = "operserv/shutdown"; permission = "operserv/shutdown"; }
@@ -668,13 +667,3 @@ command { service = "OperServ"; name = "SVSPART"; command = "operserv/svspart";
module { name = "operserv/sxline" }
command { service = "OperServ"; name = "SNLINE"; command = "operserv/snline"; permission = "operserv/snline"; }
command { service = "OperServ"; name = "SQLINE"; command = "operserv/sqline"; permission = "operserv/sqline"; }
-
-/*
- * operserv/update
- *
- * Provides the operserv/update command.
- *
- * Use to immediately update the databases.
- */
-module { name = "operserv/update" }
-command { service = "OperServ"; name = "UPDATE"; command = "operserv/update"; permission = "operserv/update"; }
diff --git a/include/anope.h b/include/anope.h
index dbaebd573..192ad271c 100644
--- a/include/anope.h
+++ b/include/anope.h
@@ -434,10 +434,6 @@ namespace Anope
*/
extern void Init(int ac, char **av);
- /** Calls the save database event
- */
- extern CoreExport void SaveDatabases();
-
/** Check whether two strings match.
* @param str The string to check against the pattern (e.g. foobar)
* @param mask The pattern to check (e.g. foo*bar)
diff --git a/include/event.h b/include/event.h
index b71eef738..fcc292aea 100644
--- a/include/event.h
+++ b/include/event.h
@@ -292,17 +292,6 @@ namespace Event
virtual void OnPostCommand(CommandSource &source, Command *command, const std::vector<Anope::string> &params) anope_abstract;
};
- struct CoreExport SaveDatabase : Events
- {
- static constexpr const char *NAME = "savedatabase";
-
- using Events::Events;
-
- /** Called when the databases are saved
- */
- virtual void OnSaveDatabase() anope_abstract;
- };
-
struct CoreExport LoadDatabase : Events
{
static constexpr const char *NAME = "loaddatabase";
diff --git a/modules/operserv/shutdown.cpp b/modules/operserv/shutdown.cpp
index 3b04528d5..030eb73f4 100644
--- a/modules/operserv/shutdown.cpp
+++ b/modules/operserv/shutdown.cpp
@@ -19,36 +19,12 @@
#include "module.h"
-class CommandOSQuit : public Command
-{
- public:
- CommandOSQuit(Module *creator) : Command(creator, "operserv/quit", 0, 0)
- {
- this->SetDesc(_("Terminate Services without saving"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
- {
- Log(LOG_ADMIN, source, this);
- Anope::QuitReason = source.command + " command received from " + source.GetNick();
- Anope::Quitting = true;
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
- {
- source.Reply(_("Causes Services to do an immediate shutdown; databases may \002not\002 saved."
- " If you are using a real time database such as SQL or Redis, this command is not useful."
- " This command should not be used unless damage to the in-memory copies of the databases is feared and they should not be saved."));
- return true;
- }
-};
-
class CommandOSRestart : public Command
{
public:
CommandOSRestart(Module *creator) : Command(creator, "operserv/restart", 0, 0)
{
- this->SetDesc(_("Save databases and restart Services"));
+ this->SetDesc(_("Restart Anope"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
@@ -56,12 +32,11 @@ class CommandOSRestart : public Command
Log(LOG_ADMIN, source, this);
Anope::QuitReason = source.command + " command received from " + source.GetNick();
Anope::Quitting = Anope::Restarting = true;
- Anope::SaveDatabases();
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
{
- source.Reply(_("Causes Services to restart."));
+ source.Reply(_("Causes Anope to restart."));
return true;
}
};
@@ -71,7 +46,7 @@ class CommandOSShutdown : public Command
public:
CommandOSShutdown(Module *creator) : Command(creator, "operserv/shutdown", 0, 0)
{
- this->SetDesc(_("Terminate services with save"));
+ this->SetDesc(_("Shutdown Anope"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
@@ -79,27 +54,25 @@ class CommandOSShutdown : public Command
Log(LOG_ADMIN, source, this);
Anope::QuitReason = source.command + " command received from " + source.GetNick();
Anope::Quitting = true;
- Anope::SaveDatabases();
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
{
- source.Reply(_("Causes Services to shut down"));
+ source.Reply(_("Causes Anope to shut down"));
return true;
}
};
class OSShutdown : public Module
{
- CommandOSQuit commandosquit;
CommandOSRestart commandosrestart;
CommandOSShutdown commandosshutdown;
public:
- OSShutdown(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
- commandosquit(this), commandosrestart(this), commandosshutdown(this)
+ OSShutdown(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR)
+ , commandosrestart(this)
+ , commandosshutdown(this)
{
-
}
};
diff --git a/modules/operserv/update.cpp b/modules/operserv/update.cpp
deleted file mode 100644
index f12047732..000000000
--- a/modules/operserv/update.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Anope IRC Services
- *
- * Copyright (C) 2003-2016 Anope Team <team@anope.org>
- *
- * This file is part of Anope. Anope is free software; you can
- * redistribute it and/or modify it under the terms of the GNU
- * General Public License as published by the Free Software
- * Foundation, version 2.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see see <http://www.gnu.org/licenses/>.
- */
-
-#include "module.h"
-
-class CommandOSUpdate : public Command
-{
- public:
- CommandOSUpdate(Module *creator) : Command(creator, "operserv/update", 0, 0)
- {
- this->SetDesc(_("Force the Services databases to be updated immediately"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
- {
- Log(LOG_ADMIN, source, this);
- source.Reply(_("Updating databases."));
- Anope::SaveDatabases();
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
- {
- source.Reply(_("Causes Services to update all database files."));
- return true;
- }
-};
-
-class OSUpdate : public Module
-{
- CommandOSUpdate commandosupdate;
-
- public:
- OSUpdate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR)
- , commandosupdate(this)
- {
-
- }
-};
-
-MODULE_INIT(OSUpdate)
diff --git a/src/init.cpp b/src/init.cpp
index 9ee720ebd..0967baa33 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -134,8 +134,6 @@ void Anope::HandleSignal()
{
case SIGHUP:
{
- Anope::SaveDatabases();
-
try
{
Configuration::Conf *new_config = new Configuration::Conf();
@@ -160,7 +158,6 @@ void Anope::HandleSignal()
Anope::QuitReason = Anope::string("Services terminating via signal ") + stringify(Signal);
#endif
Anope::Quitting = true;
- Anope::SaveDatabases();
break;
}
diff --git a/src/main.cpp b/src/main.cpp
index 33cd9b23f..5a97da7d8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -51,17 +51,6 @@ time_t Anope::CurTime = time(NULL);
int Anope::CurrentUplink = -1;
-class UpdateTimer : public Timer
-{
- public:
- UpdateTimer(time_t timeout) : Timer(timeout, Anope::CurTime, true) { }
-
- void Tick(time_t) override
- {
- Anope::SaveDatabases();
- }
-};
-
class ExpireTimer : public Timer
{
public:
@@ -73,15 +62,6 @@ class ExpireTimer : public Timer
}
};
-void Anope::SaveDatabases()
-{
- if (Anope::ReadOnly)
- return;
-
- Log(LOG_DEBUG) << "Saving databases";
- EventManager::Get()->Dispatch(&Event::SaveDatabase::OnSaveDatabase);
-}
-
/** The following comes from InspIRCd to get the full path of the Anope executable
*/
static Anope::string GetFullProgDir(const Anope::string &argv0)
@@ -163,7 +143,6 @@ int main(int ac, char **av, char **envp)
/* Set up timers */
time_t last_check = Anope::CurTime;
- UpdateTimer updateTimer(Config->GetBlock("options")->Get<time_t>("updatetimeout", "5m"));
ExpireTimer expireTimer(Config->GetBlock("options")->Get<time_t>("expiretimeout", "30m"));
/*** Main loop. ***/