update last seen property when processing listings to refresh data
This commit is contained in:
parent
480957dc72
commit
526f4fc0c3
2 changed files with 12 additions and 0 deletions
|
|
@ -193,3 +193,12 @@ class ListingRepository:
|
|||
)
|
||||
|
||||
return model_listing
|
||||
|
||||
async def mark_seen(self, listing_id: int) -> None:
|
||||
listings = await self.get_listings(only_ids=[listing_id])
|
||||
if len(listings) == 0:
|
||||
return
|
||||
listing = listings[0]
|
||||
now = datetime.now()
|
||||
listing.last_seen = now
|
||||
await self.upsert_listings([listing])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue