Skip to content

Commit

Permalink
Merge pull request #18 from offish/v2.0.1
Browse files Browse the repository at this point in the history
fix pricestf socket crashing and sort newest trades
  • Loading branch information
offish authored Nov 4, 2023
2 parents 0eec359 + 6fbab36 commit 8ca6419
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion express/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def insert_trade(self, data: dict) -> None:
def get_trades(
self, start_index: int, amount: int
) -> tuple[list[dict], int, int, int]:
all_trades = list(self.trades.find())
all_trades = list(self.trades.find().sort("time_updated", -1))
total = len(all_trades)
intended_end_index = start_index + amount
result = all_trades[start_index:intended_end_index]
Expand Down
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def on_price_change(data: dict) -> None:
if not data.get("data", {}).get("sku"):
return

logging.debug(f"Got new price change from Prices.tf {data=}")
# already easy to find in the logs
# no need to log again, takes time
# logging.debug(f"Got new price change from Prices.tf {data=}")

for bot in bots:
bot.append_new_price(data.get("data", {}))
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steampy>=1.1.0
tf2-sku>=2.0.1
tf2-data>=0.0.4
tf2-utils>=2.0.6
tf2-utils>=2.0.7
requests
pymongo
flask
Expand Down

0 comments on commit 8ca6419

Please sign in to comment.