diff --git a/app/models/transport.rb b/app/models/transport.rb index 8c72356b4..34aad45af 100644 --- a/app/models/transport.rb +++ b/app/models/transport.rb @@ -1,10 +1,18 @@ # A wrapper around AMQP to stay DRY. Will make life easier if we ever need to # change protocols module Transport + + AMQP_URL = ENV['CLOUDAMQP_URL'] || + ENV['RABBITMQ_URL'] || + "amqp://guest:guest@localhost:5672" + + def self.connection + @connection ||= Bunny.new(AMQP_URL, read_timeout: 10, heartbeat: 10).start + end + def self.topic - @topic ||= Bunny - .new(read_timeout: 10, heartbeat: 10) - .start + @topic ||= self + .connection .create_channel .topic("amq.topic", auto_delete: true) end diff --git a/latest_corpus.rb b/latest_corpus.rb index c05495e9c..ec0451a39 100755 --- a/latest_corpus.rb +++ b/latest_corpus.rb @@ -138,7 +138,6 @@ result.push(enum_type :LegalArgString, HASH[:args].map{ |x| x[:name] }.sort.uniq result.push(enum_type :LegalKindString, HASH[:nodes].map{ |x| x[:name] }.sort.uniq) result.push(enum_type :LegalSequenceKind, CeleryScriptSettingsBag::STEPS.sort) result.push(enum_type :DataChangeType, CeleryScriptSettingsBag::ALLOWED_CHAGES) -result.push(enum_type :ResourceName, CeleryScriptSettingsBag::RESOURCE_NAME) result.push(enum_type :PointType, CeleryScriptSettingsBag::ALLOWED_POINTER_TYPE) puts result.join.gsub("\n\n\n", "\n")