diff options
-rw-r--r-- | src/modules/m_xline_db.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/m_xline_db.cpp b/src/modules/m_xline_db.cpp index 93b13029d..d77f8e919 100644 --- a/src/modules/m_xline_db.cpp +++ b/src/modules/m_xline_db.cpp @@ -19,12 +19,17 @@ class ModuleXLineDB : public Module { std::vector<XLine *> xlines; + bool reading_db; // If this is true, addlines are as a result of db reading, so don't bother flushing the db to disk. + // DO REMEMBER TO SET IT, otherwise it's annoying :P public: ModuleXLineDB(InspIRCd* Me) : Module(Me) { Implementation eventlist[] = { I_OnAddLine, I_OnDelLine }; ServerInstance->Modules->Attach(eventlist, this, 2); + + reading_db = true; ReadDatabase(); + reading_db = false; } virtual ~ModuleXLineDB() @@ -47,7 +52,10 @@ class ModuleXLineDB : public Module ServerInstance->Config->ServerName, line->set_time, line->duration, line->reason); } - WriteDatabase(); + if (!reading_db) + { + WriteDatabase(); + } } /** Called whenever an xline is deleted. |