FIX: Ensure directory exists.

This commit is contained in:
Guo Xiang Tan 2017-04-07 15:50:17 +08:00
parent 71501feaf3
commit f534f041a0

View File

@ -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)