diff --git a/lib/abf_worker/file_system_worker.rb b/lib/abf_worker/file_system_worker.rb deleted file mode 100644 index 62d2fbe77..000000000 --- a/lib/abf_worker/file_system_worker.rb +++ /dev/null @@ -1,15 +0,0 @@ -module AbfWorker - class FileSystemWorker - @queue = :file_system_worker - - def self.perform(options) - id, action = options['id'], options['action'] - case options['type'] - when 'repository' - @runner = AbfWorker::Runners::Repository.new id, action - end - @runner.run - end - - end -end \ No newline at end of file diff --git a/lib/abf_worker/runners/base.rb b/lib/abf_worker/runners/base.rb deleted file mode 100644 index 08841b30c..000000000 --- a/lib/abf_worker/runners/base.rb +++ /dev/null @@ -1,20 +0,0 @@ -module AbfWorker - module Runners - class Base - - # @param [String] action The action which should be run (create/destroy) - def initialize(action) - @action = action - end - - def run - send @action - end - - def mk_dir(path) - Dir.mkdir(path) unless File.exists?(path) - end - - end - end -end \ No newline at end of file diff --git a/lib/abf_worker/runners/repository.rb b/lib/abf_worker/runners/repository.rb deleted file mode 100644 index feb0abc45..000000000 --- a/lib/abf_worker/runners/repository.rb +++ /dev/null @@ -1,35 +0,0 @@ -module AbfWorker - module Runners - class Repository < AbfWorker::Runners::Base - - # @param [String] id The id of repository - def initialize(id, action) - super action - @repository = ::Repository.find id - end - - protected - - def destroy - platform = @repository.platform - repository_path = platform.path - repository_path << '/repository' - if platform.personal? - ::Platform.main.pluck(:name).each do |main_platform_name| - destroy_repositories "#{repository_path}/#{main_platform_name}" - end - else - destroy_repositories repository_path - end - end - - def destroy_repositories(repository_path) - ::Arch.pluck(:name).each do |arch| - system("rm -rf #{repository_path}/#{arch}/#{@repository.name}") - end - system("rm -rf #{repository_path}/SRPMS/#{@repository.name}") - end - - end - end -end \ No newline at end of file