diff options
author | Adam <Adam@anope.org> | 2014-07-26 13:24:52 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-07-26 13:24:52 -0400 |
commit | 60229b15d2637369977596f742b234b52a6f6f1a (patch) | |
tree | 18a529df8a97d1eef0e0660a429834b978bc88c2 /modules/database/db_sql_live.cpp | |
parent | 3c88f3b8cf7c6536894d7fe74cd2a4c33d246814 (diff) |
When object unserialization fails (due to not having dependency objects) bump the ts to try again later.
Diffstat (limited to 'modules/database/db_sql_live.cpp')
-rw-r--r-- | modules/database/db_sql_live.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp index b9b8ef57c..fda68524d 100644 --- a/modules/database/db_sql_live.cpp +++ b/modules/database/db_sql_live.cpp @@ -166,7 +166,7 @@ class DBMySQL : public Module, public Pipe if (!this->CheckInit() || obj->GetTimestamp() == Anope::CurTime) return; - Query query("SELECT * FROM `" + this->prefix + obj->GetName() + "` WHERE (`timestamp` > " + this->SQL->FromUnixtime(obj->GetTimestamp()) + " OR `timestamp` IS NULL)"); + Query query("SELECT * FROM `" + this->prefix + obj->GetName() + "` WHERE (`timestamp` >= " + this->SQL->FromUnixtime(obj->GetTimestamp()) + " OR `timestamp` IS NULL)"); obj->UpdateTimestamp(); @@ -228,7 +228,10 @@ class DBMySQL : public Module, public Pipe } else { - delete s; + if (!s) + this->RunQuery("UPDATE `" + prefix + obj->GetName() + "` SET `timestamp` = " + this->SQL->FromUnixtime(obj->GetTimestamp()) + " WHERE `id` = " + stringify(id)); + else + delete s; } } } |