From d84d3b10a173552ad8d449c140dd2e849c41510e Mon Sep 17 00:00:00 2001 From: threnjen Date: Fri, 20 Dec 2024 18:01:09 -0800 Subject: [PATCH] add additional reporting --- modules/rag_description_generation/rag_dynamodb.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/rag_description_generation/rag_dynamodb.py b/modules/rag_description_generation/rag_dynamodb.py index 18b29b5..b7d16ec 100644 --- a/modules/rag_description_generation/rag_dynamodb.py +++ b/modules/rag_description_generation/rag_dynamodb.py @@ -37,6 +37,7 @@ def check_dynamo_db_key(self, game_id: str) -> bool: # make a default timestamp that is the standard 1970 01 01 default default_timestamp = "19700101" + days_since_last_process = 3 try: item = self.dynamodb_client.get_item( @@ -46,8 +47,15 @@ def check_dynamo_db_key(self, game_id: str) -> bool: db_timestamp = datetime.strptime(db_timestamp_str, "%Y%m%d") # determine if datetime.now() is more than three days after the db_timestamp - if (datetime.now() - db_timestamp).days < 3: + if (datetime.now() - db_timestamp).days < days_since_last_process: + print( + f"Game {game_id} already processed within last {days_since_last_process} days" + ) return True + print( + f"Game {game_id} found but not processed within last {days_since_last_process} days" + ) return False except: + print(f"Game {game_id} not found in DynamoDB") return False