forked from openlp/openlp
Add a 10ms wait before trying again.
This commit is contained in:
parent
3a2686be24
commit
4fdd9708b0
openlp/plugins
@ -32,6 +32,7 @@ import logging
|
||||
import os
|
||||
import re
|
||||
import sqlite3
|
||||
import time
|
||||
|
||||
from PyQt4 import QtCore
|
||||
from sqlalchemy import Column, ForeignKey, or_, Table, types, func
|
||||
@ -262,7 +263,8 @@ class BibleDB(QtCore.QObject, Manager):
|
||||
try:
|
||||
self.session.commit()
|
||||
except OperationalError:
|
||||
# Try again. If it fails again, let the exception happen
|
||||
# Wait 10ms and try again.
|
||||
time.sleep(0.01)
|
||||
self.session.commit()
|
||||
|
||||
def create_verse(self, book_id, chapter, verse, text):
|
||||
@ -1067,7 +1069,7 @@ class OldBibleDB(QtCore.QObject, Manager):
|
||||
QtCore.QObject.__init__(self)
|
||||
if u'path' not in kwargs:
|
||||
raise KeyError(u'Missing keyword argument "path".')
|
||||
if u'file' not in kwargs:
|
||||
if u'file' not in kwargs:
|
||||
raise KeyError(u'Missing keyword argument "file".')
|
||||
if u'path' in kwargs:
|
||||
self.path = kwargs[u'path']
|
||||
|
@ -593,8 +593,11 @@ class HttpConnection(object):
|
||||
for header, value in response.headers.iteritems():
|
||||
http += '%s: %s\r\n' % (header, value)
|
||||
http += '\r\n'
|
||||
self.socket.write(http)
|
||||
self.socket.write(response.content)
|
||||
if self.socket:
|
||||
# Write to the socket if it's open, else ignore it.
|
||||
# See http://support.openlp.org/scp/tickets.php?id=2112
|
||||
self.socket.write(http)
|
||||
self.socket.write(response.content)
|
||||
|
||||
def disconnected(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user