Skip to content

Commit 1939d75

Browse files
committed
make lookback a param for easier testing
1 parent 032cc03 commit 1939d75

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spotbot.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def is_entity_recent(entity):
5050
return False
5151
ent_time = entity.metadata['timestamp']
5252
cur_time = datetime.datetime.now(datetime.timezone.utc)
53-
two_hours_in_seconds = 60 * 60 * 2
54-
return (cur_time - ent_time).total_seconds() < two_hours_in_seconds
53+
lookback_seconds = os.getenv('LOOKBACK_SECONDS', 7200)
54+
return (cur_time - ent_time).total_seconds() < lookback_seconds
5555

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

0 commit comments

Comments
 (0)