-
-
Notifications
You must be signed in to change notification settings - Fork 462
models: port to hishel 1.0 #3700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
3ae5d0e to
a3d89d9
Compare
fd84e98 to
4bea968
Compare
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
4bea968 to
56b87fe
Compare
frostming
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is generally good, with some minor tweaks
| storage = hishel.FileStorage(serializer=MsgPackSerializer(), base_path=cache_dir, ttl=CACHES_TTL) | ||
| controller = hishel.Controller() | ||
| # clean up old (pre-hishel 1.0) cache | ||
| cache_db = cache_dir / "pdm.db" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like the file to be named http-cache.sqlite
| if self.connection is None: | ||
| # Create cache directory and resolve full path on first connection | ||
| parent = self.database_path.parent if self.database_path.parent != Path(".") else None | ||
| full_path = hishel._utils.ensure_cache_dict(parent) / self.database_path.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not worth a import from hishel._utils, just use path.mkdir() instead.
Pull Request Checklist
news/describing what is new.Describe what you have changed in this PR.
SyncSqliteStorageFixes: #3657