]> Some of my projects - localmylist.git/commitdiff
Fix how requests failed with data errors interacts with failing requests from old...
authorAPTX <marek321@gmail.com>
Tue, 4 Jun 2013 18:32:15 +0000 (20:32 +0200)
committerAPTX <marek321@gmail.com>
Tue, 4 Jun 2013 18:32:15 +0000 (20:32 +0200)
Failing requests from old clients ignores failed requests. Failing a request with a data error sets the client_id to 0.

localmylist/database.cpp

index b06aaaed06bb3e064de1d70e24db1581f926fa9e..c98070f129317e4a8a0a8ccbd0a08d7e40e02eaf 100644 (file)
@@ -1321,6 +1321,7 @@ bool Database::failPendingRequestsFromOldClients()
        "       SET start = NULL, client_id = 0, "
        "               connection_error_count = connection_error_count + 1 "
        "       WHERE start IS NOT NULL "
+       "               AND failed IS NOT NULL "
        "               AND client_id < :clientId ");
        q.bindValue(":clientId", clientId);
 
@@ -1331,7 +1332,7 @@ bool Database::pendingRequestDataError(const PendingRequest &request)
 {
        QSqlQuery &q = prepare(
        "UPDATE pending_request "
-       "       SET failed = now() "
+       "       SET failed = now(), client_id = 0 "
        "       WHERE aid = :aid "
        "               AND eid = :eid "
        "               AND fid = :fid "