Skip to content
This repository was archived by the owner on Mar 8, 2025. It is now read-only.

Commit

Permalink
Check if auction has been started before trying to subscribe to its bids
Browse files Browse the repository at this point in the history
  • Loading branch information
ktecho committed Mar 20, 2024
1 parent c4cafb0 commit fc401e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion birdwatcher/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ async def process_event(self, event):
auction = json.loads(event['content'])
except:
auction = None
if isinstance(auction, dict) and 'start_date' in auction and 'duration' in auction:

if isinstance(auction, dict) and 'start_date' in auction and auction['start_date'] and 'duration' in auction and auction['duration']:
if datetime.fromtimestamp(auction['start_date']) + timedelta(seconds=auction['duration']) > datetime.utcnow():
await self.check_ours(event, self.subscribe_bids)
case EventKind.STALL:
Expand Down

0 comments on commit fc401e8

Please sign in to comment.