Skip to content

Commit

Permalink
remove ResourcesT.cached_timestamp()
Browse files Browse the repository at this point in the history
Signed-off-by: flashdagger <flashdagger@googlemail.com>
  • Loading branch information
flashdagger committed Mar 23, 2024
1 parent 2b02e7a commit 05d49e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions zammadoo/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def reload(self, expand=False) -> None:
info.update(new_info)

def last_request_at(self) -> Optional[datetime]:
""":return: the last request timestamp as :class:`datetime` or ``None``"""
return self.parent.cached_timestamp(self.id)
""":return: the last request timestamp"""
return self.parent.cache.timestamp(self.url)


class UserProperty:
Expand Down
4 changes: 0 additions & 4 deletions zammadoo/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import weakref
from dataclasses import asdict
from datetime import datetime
from functools import partial
from typing import (
TYPE_CHECKING,
Expand Down Expand Up @@ -88,9 +87,6 @@ def cached_info(self, rid: int, refresh=True, expand=False) -> "JsonDict":

return cache.setdefault_by_callback(item, callback)

def cached_timestamp(self, rid: int) -> Optional[datetime]:
return self.cache.timestamp(f"{self.url}/{rid}")

def delete(self, rid: int) -> None:
""":meta private:"""
item = f"{self.url}/{rid}"
Expand Down

0 comments on commit 05d49e7

Please sign in to comment.