Allow transaction errors
This commit is contained in:
parent
4e96ddfb9e
commit
60fc5fb4d3
2 changed files with 9 additions and 4 deletions
|
@ -157,7 +157,10 @@ class ContentDbPlugin(object):
|
||||||
def setContentFilesOptional(self, site, content_inner_path, content, cur=None):
|
def setContentFilesOptional(self, site, content_inner_path, content, cur=None):
|
||||||
if not cur:
|
if not cur:
|
||||||
cur = self
|
cur = self
|
||||||
cur.execute("BEGIN")
|
try:
|
||||||
|
cur.execute("BEGIN")
|
||||||
|
except Exception, err:
|
||||||
|
self.log.warning("Transaction begin error %s %s: %s" % (site, content_inner_path, Debug.formatException(err)))
|
||||||
|
|
||||||
num = 0
|
num = 0
|
||||||
site_id = self.site_ids[site.address]
|
site_id = self.site_ids[site.address]
|
||||||
|
@ -190,8 +193,10 @@ class ContentDbPlugin(object):
|
||||||
num += 1
|
num += 1
|
||||||
|
|
||||||
if cur == self:
|
if cur == self:
|
||||||
cur.execute("END")
|
try:
|
||||||
|
cur.execute("END")
|
||||||
|
except Exception, err:
|
||||||
|
self.log.warning("Transaction end error %s %s: %s" % (site, content_inner_path, Debug.formatException(err)))
|
||||||
return num
|
return num
|
||||||
|
|
||||||
def setContent(self, site, inner_path, content, size=0):
|
def setContent(self, site, inner_path, content, size=0):
|
||||||
|
|
|
@ -212,7 +212,7 @@ class ContentManager(object):
|
||||||
# Update the content
|
# Update the content
|
||||||
self.contents[content_inner_path] = new_content
|
self.contents[content_inner_path] = new_content
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
self.log.warning("Content.json parse error: %s" % Debug.formatException(err))
|
self.log.warning("%s parse error: %s" % (content_inner_path, Debug.formatException(err)))
|
||||||
return [], [] # Content.json parse error
|
return [], [] # Content.json parse error
|
||||||
|
|
||||||
# Add changed files to bad files
|
# Add changed files to bad files
|
||||||
|
|
Loading…
Reference in a new issue