Skip to content

Commit

Permalink
add additional reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
threnjen committed Dec 21, 2024
1 parent c37c45c commit d84d3b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/rag_description_generation/rag_dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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

0 comments on commit d84d3b1

Please sign in to comment.