diff options
author | Ted Trask <ttrask01@yahoo.com> | 2010-10-08 07:57:27 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2010-10-08 07:57:27 +0000 |
commit | 7e3564f6a03ae3d40602b4cbf604ad56e1f2782c (patch) | |
tree | cf81522cf30a7e9d7dcea7e81e12cfa308395eb8 | |
parent | ed427f5a10489e50d32b3f1a45783b256e5f2f10 (diff) | |
download | acf-weblog-7e3564f6a03ae3d40602b4cbf604ad56e1f2782c.tar.bz2 acf-weblog-7e3564f6a03ae3d40602b4cbf604ad56e1f2782c.tar.xz |
Move the line error messages out of the transaction when importing.
Stangely enough, I saw a case where the logme resulted in an error, and the whole transaction was lost.
-rw-r--r-- | weblog-model.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/weblog-model.lua b/weblog-model.lua index a69f417..f5f339c 100644 --- a/weblog-model.lua +++ b/weblog-model.lua @@ -876,6 +876,7 @@ local function importlogfile(source, cookiesfile, file, parselog_func, importlog pcall(function() con:execute("ROLLBACK") end) else assert(con:execute("ROLLBACK TO before_line")) + con:execute("COMMIT") end pcall(function() logme("Exception on line:"..line) end) if err2 then @@ -883,6 +884,8 @@ local function importlogfile(source, cookiesfile, file, parselog_func, importlog end if (config.stoponerror == "true") then assert(res2, "Import halted on exception") + else + con:execute("START TRANSACTION") end end end |