Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
m5l14i11 committed Apr 27, 2024
1 parent b4bb46b commit 3b68f49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion position/_actor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import logging
import time
from typing import Union

from core.actors import Actor
Expand Down Expand Up @@ -87,7 +88,9 @@ async def on_receive(self, event):
)

async def handle_signal_received(self, event: SignalEvent) -> bool:
logger.info(f"Signal Received: {event}")
if int(event.meta.timestamp) < int(time.time()) - 3:
logger.warn(f"Stale Signal: {event}, {time.time()}")
return False

async def create_and_store_position(event: SignalEvent):
position = await self.position_factory.create_position(
Expand Down

0 comments on commit 3b68f49

Please sign in to comment.