mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
FIX: Do not change directory when decompressing S3 inventory
In sidekiq, jobs are run in multiple threads within the same process. `cd` affects the entire process, so can cause unexpected issues in other running jobs.
This commit is contained in:
@ -125,11 +125,9 @@ class S3Inventory
|
||||
end
|
||||
|
||||
def decompress_inventory_files
|
||||
FileUtils.cd(tmp_directory) do
|
||||
files.each do |file|
|
||||
log "Decompressing inventory file '#{file[:filename]}', this may take a while..."
|
||||
Discourse::Utils.execute_command('gzip', '--decompress', file[:filename], failure_message: "Failed to decompress inventory file '#{file[:filename]}'.")
|
||||
end
|
||||
files.each do |file|
|
||||
log "Decompressing inventory file '#{file[:filename]}', this may take a while..."
|
||||
Discourse::Utils.execute_command('gzip', '--decompress', file[:filename], failure_message: "Failed to decompress inventory file '#{file[:filename]}'.", chdir: tmp_directory)
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user