From aff658a947d52dea1a1c70aca91bfee52109802f Mon Sep 17 00:00:00 2001 From: r888888888 Date: Thu, 22 May 2014 17:42:34 -0700 Subject: [PATCH] fixes #1367 --- app/logical/api_cache_generator.rb | 4 ++-- config/danbooru_default_config.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/logical/api_cache_generator.rb b/app/logical/api_cache_generator.rb index e0aa15f1e..d32090ca4 100644 --- a/app/logical/api_cache_generator.rb +++ b/app/logical/api_cache_generator.rb @@ -1,6 +1,6 @@ class ApiCacheGenerator def generate_tag_cache - path = File.expand_path(File.join(Rails.root, "..", "shared")) + path = Danbooru.config.shared_dir_path FileUtils.mkdir_p("#{path}/system/cache") File.open("#{path}/system/cache/tags.json", "w") do |f| f.print("[") @@ -26,6 +26,6 @@ class ApiCacheGenerator gz.close end RemoteFileManager.new("#{path}/system/cache/tags.json").distribute - RemoteFileManager.new("#{path}/shared/system/cache/tags.json.gz").distribute + RemoteFileManager.new("#{path}/system/cache/tags.json.gz").distribute end end diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index e3cfd8c67..4cebafd37 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -310,5 +310,9 @@ module Danbooru # /var/www/danbooru2/shared/iqdb.db nil end + + def shared_dir_path + "/var/www/danbooru2/shared" + end end end