summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2010-10-08 07:57:27 +0000
committerTed Trask <ttrask01@yahoo.com>2010-10-08 07:57:27 +0000
commit7e3564f6a03ae3d40602b4cbf604ad56e1f2782c (patch)
treecf81522cf30a7e9d7dcea7e81e12cfa308395eb8
parented427f5a10489e50d32b3f1a45783b256e5f2f10 (diff)
downloadacf-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.lua3
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