Configure the source of dir listing (redis or swift)
This commit is contained in:
parent
15196ca4b9
commit
737be34e73
@ -20,6 +20,7 @@ development: &defaults
|
||||
# redis:
|
||||
# host: localhost
|
||||
# port: 6379
|
||||
# use_redis_dir_listing: true
|
||||
|
||||
test:
|
||||
<<: *defaults
|
||||
|
@ -75,6 +75,14 @@ module RemoteStorage
|
||||
end
|
||||
|
||||
def get_directory_listing(user, directory)
|
||||
if settings.use_redis_dir_listing
|
||||
get_directory_listing_from_redis(user, directory)
|
||||
else
|
||||
get_directory_listing_from_swift
|
||||
end
|
||||
end
|
||||
|
||||
def get_directory_listing_from_redis(user, directory)
|
||||
etag = redis.hget "rs_meta:#{user}:#{directory}/", "etag"
|
||||
|
||||
none_match = (server.env["HTTP_IF_NONE_MATCH"] || "").split(",").map(&:strip)
|
||||
|
Loading…
x
Reference in New Issue
Block a user