I'm running my rails application in a docker container, I'm using an after_initialize to start listening on a folder personal_files, but I don't want to listen to his subfolder called processed.
# /rails/config/initializers/guard_listen.rb
Rails.application.config.after_initialize do
# Listen to file edits on personal_files folder
listener = Listen.to("personal_files", force_polling: true, ignore: [%r{/personal_files/processed}]) do |modified, added, removed|
puts "Listen\nmodified: #{modified.inspect}\nadded: #{added.inspect}\nremoved: #{removed.inspect}"
... process the images
end
listener.start
end
end
I always receive a callback when a file is added or removed from the folder processed. I tried all the combinations I could think, even the full path (the full path inside the docker container) but nothing worked.
Any help? By the way, which is the correct way to ignore a subfolder?
I'm running my rails application in a docker container, I'm using an
after_initialize
to start listening on a folderpersonal_files
, but I don't want to listen to his subfolder calledprocessed
.I always receive a callback when a file is added or removed from the folder
processed
. I tried all the combinations I could think, even the full path (the full path inside the docker container) but nothing worked.Any help? By the way, which is the correct way to ignore a subfolder?