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:
|
# redis:
|
||||||
# host: localhost
|
# host: localhost
|
||||||
# port: 6379
|
# port: 6379
|
||||||
|
# use_redis_dir_listing: true
|
||||||
|
|
||||||
test:
|
test:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
|
@ -75,6 +75,14 @@ module RemoteStorage
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get_directory_listing(user, directory)
|
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"
|
etag = redis.hget "rs_meta:#{user}:#{directory}/", "etag"
|
||||||
|
|
||||||
none_match = (server.env["HTTP_IF_NONE_MATCH"] || "").split(",").map(&:strip)
|
none_match = (server.env["HTTP_IF_NONE_MATCH"] || "").split(",").map(&:strip)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user