Flush prices rather than commit, it takes much less time and still satisfies our needs
This commit is contained in:
@@ -542,7 +542,17 @@ def commit():
|
||||
with sd_lock:
|
||||
try:
|
||||
saveddata_session.commit()
|
||||
except Exception as ex:
|
||||
except Exception:
|
||||
saveddata_session.rollback()
|
||||
exc_info = sys.exc_info()
|
||||
raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
|
||||
|
||||
|
||||
def flush():
|
||||
with sd_lock:
|
||||
try:
|
||||
saveddata_session.flush()
|
||||
except Exception:
|
||||
saveddata_session.rollback()
|
||||
exc_info = sys.exc_info()
|
||||
raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
|
||||
|
||||
@@ -458,7 +458,7 @@ class Item(EqBase):
|
||||
pyfalog.debug("Creating a price for {}".format(self.ID))
|
||||
self.__priceObj = types_Price(self.ID)
|
||||
eos.db.add(self.__priceObj)
|
||||
eos.db.commit()
|
||||
eos.db.flush()
|
||||
else:
|
||||
self.__priceObj = db_price
|
||||
|
||||
|
||||
Reference in New Issue
Block a user