Sha256: a62e7ee4e9e282434ab1d50975aba45abd80ae8b51079368715e8fb6ace3b341

Contents?: true

Size: 758 Bytes

Versions: 6

Compression:

Stored size: 758 Bytes

Contents

module Stackify
  class LogsSenderWorker < Worker

    def initialize name = 'LogsSender worker'
      super
      case Stackify.configuration.transport
      when Stackify::DEFAULT
        name = 'LogsSender worker'
      when Stackify::UNIX_SOCKET
        name = 'UnixSocketSender worker'
      when Stackify::AGENT_HTTP
        name = 'AgentHTTPSender worker'
      end
      @name = name
      @name += " ##{self.id}"
      @type = :logs_send
    end

    def after_perform result
      if result.try(:status) == 200
        Stackify.internal_log :info, "#{@name}: Sending batch of msgs is successfully completed"
      else
        Stackify.log_internal_error "#{@name}: Sending batch of msgs is failed: #{result.try(:msg)}"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
stackify-api-ruby-2.1.0 lib/stackify/workers/logs_sender_worker.rb
stackify-api-ruby-2.1.0.beta1 lib/stackify/workers/logs_sender_worker.rb
stackify-api-ruby-2.0.0 lib/stackify/workers/logs_sender_worker.rb
stackify-api-ruby-1.3.0.beta1 lib/stackify/workers/logs_sender_worker.rb
stackify-api-ruby-1.2.10 lib/stackify/workers/logs_sender_worker.rb
stackify-api-ruby-1.2.9 lib/stackify/workers/logs_sender_worker.rb