gitlab-org--gitlab-foss/app/models/system_hook.rb

25 lines
545 B
Ruby
Raw Normal View History

2012-11-19 13:24:05 -05:00
# == Schema Information
#
# Table name: web_hooks
#
# id :integer not null, primary key
# url :string(255)
# project_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# type :string(255) default("ProjectHook")
2012-11-20 07:19:55 -05:00
# service_id :integer
2012-11-19 13:24:05 -05:00
#
class SystemHook < WebHook
2012-07-15 08:29:06 -04:00
def self.all_hooks_fire(data)
SystemHook.all.each do |sh|
sh.async_execute data
end
end
2012-10-08 20:10:04 -04:00
def async_execute(data)
2013-01-09 00:14:05 -05:00
Sidekiq::Client.enqueue(SystemHookWorker, id, data)
2012-10-08 20:10:04 -04:00
end
end