Skip to content

Commit

Permalink
make lookback a param for easier testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tblanarik committed Sep 23, 2024
1 parent 032cc03 commit 1939d75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spotbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def is_entity_recent(entity):
return False
ent_time = entity.metadata['timestamp']
cur_time = datetime.datetime.now(datetime.timezone.utc)
two_hours_in_seconds = 60 * 60 * 2
return (cur_time - ent_time).total_seconds() < two_hours_in_seconds
lookback_seconds = os.getenv('LOOKBACK_SECONDS', 7200)
return (cur_time - ent_time).total_seconds() < lookback_seconds

def call_target(content, messageId=None):
target_url = os.getenv('TARGET_URL')
Expand Down

0 comments on commit 1939d75

Please sign in to comment.