Add Trade.commit method for easy use
This commit is contained in:
@@ -74,7 +74,7 @@ def cleanup_db() -> None:
|
||||
Flushes all pending operations to disk.
|
||||
:return: None
|
||||
"""
|
||||
Trade.query.session.commit()
|
||||
Trade.commit()
|
||||
|
||||
|
||||
def clean_dry_run_db() -> None:
|
||||
@@ -86,7 +86,7 @@ def clean_dry_run_db() -> None:
|
||||
# Check we are updating only a dry_run order not a prod one
|
||||
if 'dry_run' in trade.open_order_id:
|
||||
trade.open_order_id = None
|
||||
Trade.query.session.commit()
|
||||
Trade.commit()
|
||||
|
||||
|
||||
class Order(_DECL_BASE):
|
||||
@@ -711,6 +711,10 @@ class Trade(_DECL_BASE, LocalTrade):
|
||||
Order.query.session.delete(order)
|
||||
|
||||
Trade.query.session.delete(self)
|
||||
Trade.commit()
|
||||
|
||||
@staticmethod
|
||||
def commit():
|
||||
Trade.query.session.commit()
|
||||
|
||||
@staticmethod
|
||||
|
Reference in New Issue
Block a user