From f534f041a033a3f7ac1afa687527d591057e5adc Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 7 Apr 2017 15:50:17 +0800 Subject: [PATCH] FIX: Ensure directory exists. --- lib/file_store/local_store.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/file_store/local_store.rb b/lib/file_store/local_store.rb index 3e5931ae8a0..9b7148efc8c 100644 --- a/lib/file_store/local_store.rb +++ b/lib/file_store/local_store.rb @@ -59,7 +59,11 @@ module FileStore end def purge_tombstone(grace_period) - Discourse::Utils.execute_command('find', tombstone_dir, '-mtime', "+#{grace_period}", '-type', 'f', '-delete') + if Dir.exists?(Discourse.store.tombstone_dir) + Discourse::Utils.execute_command( + 'find', tombstone_dir, '-mtime', "+#{grace_period}", '-type', 'f', '-delete' + ) + end end def get_path_for(type, upload_id, sha, extension)