fix bug with files geting uploaded to wrong servers

This commit is contained in:
Albert Yi
2018-06-18 14:20:33 -07:00
parent cc24b0a54f
commit cd043c4868

View File

@@ -100,6 +100,8 @@ class UploadService
end
def self.distribute_files(file, record, type)
# need to do this for hybrid storage manager
record.id = nil
[Danbooru.config.storage_manager, Danbooru.config.backup_storage_manager].each do |sm|
sm.store_file(file, record, type)
end
@@ -291,8 +293,10 @@ class UploadService
return
end
if Post.where(source: source).exists?
return
CurrentUser.as_system do
if Post.tag_match("source:#{source}").exists?
return
end
end
if Upload.where(source: source, status: "completed").exists?