Skip to content

Commit

Permalink
Fix duplicate sales entry issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kractero committed Jan 17, 2024
1 parent 48732c7 commit 3a24753
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ def getLatestThousandTrades(timestamp=datetime.datetime.now().timestamp()):
if not trades:
return

timestamp = 0
next_recursive_timestamp = trades[-1].find('TIMESTAMP').text
data = []
for trade_elem in trades:
for trade_elem in trades[:-1]:
buyer = trade_elem.find('BUYER').text
card_id = trade_elem.find('CARDID').text
category = trade_elem.find('CATEGORY').text
Expand Down Expand Up @@ -109,7 +109,7 @@ def getLatestThousandTrades(timestamp=datetime.datetime.now().timestamp()):

cur.executemany("INSERT INTO trades VALUES (?, ?, ?, ?, ?, ?, ?, ?)", data)

getLatestThousandTrades(timestamp)
getLatestThousandTrades(next_recursive_timestamp)

getLatestThousandTrades()

Expand Down

0 comments on commit 3a24753

Please sign in to comment.