Skip to content

Commit

Permalink
feat: add creation time for insertion!
Browse files Browse the repository at this point in the history
  • Loading branch information
amindadgar committed Nov 4, 2024
1 parent 88a2eb5 commit 03d8bcb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utils/persist_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ def persist_http(self, payload: HTTPPayload, update: bool = False) -> None:
try:
if not update:
self.client[self.db][self.external_msgs_collection].insert_one(
payload.model_dump()
{
**payload.model_dump(),
"createdAt": datetime.now().replace(tzinfo=timezone.utc),
"updatedAt": datetime.now().replace(tzinfo=timezone.utc),
}
)
logging.info(
"Added HTTP Payload for community id: "
Expand Down

0 comments on commit 03d8bcb

Please sign in to comment.