Skip to content

Commit

Permalink
Name the arguments to MongoWrapper and RedisWrapper
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Kanakarakis <[email protected]>
  • Loading branch information
c00kiemon5ter committed Jul 12, 2021
1 parent 0fc2e45 commit 1c82c47
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pyop/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ def pop(self, key, default=None):
@classmethod
def from_uri(cls, db_uri, collection, db_name=None, ttl=None):
if db_uri.startswith("mongodb"):
return MongoWrapper(db_uri, db_name, collection, ttl)
if db_uri.startswith("redis") or db_uri.startswith("unix"):
return RedisWrapper(db_uri, collection, ttl)
return MongoWrapper(
db_uri=db_uri, db_name=db_name, collection=collection, ttl=ttl
)
elif db_uri.startswith("redis") or db_uri.startswith("unix"):
return RedisWrapper(db_uri=db_uri, collection=collection, ttl=ttl)

return ValueError(f"Invalid DB URI: {db_uri}")

Expand Down

0 comments on commit 1c82c47

Please sign in to comment.