Skip to content

Commit

Permalink
fix: update the last successful update only when it's greater
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyvan committed Mar 13, 2024
1 parent 007bac4 commit 8545a86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example_publisher/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async def on_notify_price_sched(self, subscription: int) -> None:
await self.pythd.update_price(
product.price_account, scaled_price, scaled_conf, TRADING
)
self.last_successful_update = price.timestamp
self.last_successful_update = max(self.last_successful_update, price.timestamp)

def apply_exponent(self, x: float, exp: int) -> int:
return int(x * (10 ** (-exp)))

0 comments on commit 8545a86

Please sign in to comment.