zuora_connect 3.0.0.pre.g → 3.0.0.pre.n

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/app/models/zuora_connect/app_instance_base.rb +19 -6
  4. data/app/models/zuora_connect/telegraf.rb +73 -0
  5. data/config/initializers/postgresql_adapter.rb +1 -1
  6. data/config/initializers/prometheus.rb +0 -23
  7. data/config/initializers/resque.rb +0 -14
  8. data/config/initializers/unicorn.rb +1 -1
  9. data/lib/metrics/influx/point_value.rb +79 -0
  10. data/lib/metrics/net.rb +7 -7
  11. data/lib/middleware/metrics_middleware.rb +35 -1
  12. data/lib/resque/plugins/app_instance_job.rb +9 -5
  13. data/lib/zuora_connect.rb +1 -0
  14. data/lib/zuora_connect/controllers/helpers.rb +6 -2
  15. data/lib/zuora_connect/railtie.rb +3 -0
  16. data/lib/zuora_connect/version.rb +1 -1
  17. metadata +44 -96
  18. data/test/controllers/zuora_connect/api/v1/app_instance_controller_test.rb +0 -13
  19. data/test/dummy/README.rdoc +0 -28
  20. data/test/dummy/Rakefile +0 -6
  21. data/test/dummy/app/assets/javascripts/application.js +0 -13
  22. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  23. data/test/dummy/app/controllers/application_controller.rb +0 -5
  24. data/test/dummy/app/helpers/application_helper.rb +0 -2
  25. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  26. data/test/dummy/bin/bundle +0 -3
  27. data/test/dummy/bin/rails +0 -4
  28. data/test/dummy/bin/rake +0 -4
  29. data/test/dummy/bin/setup +0 -29
  30. data/test/dummy/config.ru +0 -4
  31. data/test/dummy/config/application.rb +0 -26
  32. data/test/dummy/config/boot.rb +0 -5
  33. data/test/dummy/config/database.yml +0 -25
  34. data/test/dummy/config/environment.rb +0 -5
  35. data/test/dummy/config/environments/development.rb +0 -41
  36. data/test/dummy/config/environments/production.rb +0 -79
  37. data/test/dummy/config/environments/test.rb +0 -42
  38. data/test/dummy/config/initializers/assets.rb +0 -11
  39. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  40. data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  41. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  42. data/test/dummy/config/initializers/inflections.rb +0 -16
  43. data/test/dummy/config/initializers/mime_types.rb +0 -4
  44. data/test/dummy/config/initializers/session_store.rb +0 -3
  45. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  46. data/test/dummy/config/locales/en.yml +0 -23
  47. data/test/dummy/config/routes.rb +0 -4
  48. data/test/dummy/config/secrets.yml +0 -22
  49. data/test/dummy/public/404.html +0 -67
  50. data/test/dummy/public/422.html +0 -67
  51. data/test/dummy/public/500.html +0 -66
  52. data/test/dummy/public/favicon.ico +0 -0
  53. data/test/fixtures/zuora_connect/app_instances.yml +0 -11
  54. data/test/integration/navigation_test.rb +0 -8
  55. data/test/lib/generators/zuora_connect/datatable_generator_test.rb +0 -16
  56. data/test/models/zuora_connect/app_instance_test.rb +0 -9
  57. data/test/test_helper.rb +0 -21
  58. data/test/zuora_connect_test.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7443cb29882ccc12bc04d9e58f21fe54dbae32e6b4e7ffe12b699b63854cce55
4
- data.tar.gz: 9b87ed757abeca777bff58cf469f6e7d918aeacf304ec98bcd6bb02458195754
3
+ metadata.gz: e800e6da56132f3a8b5e0f52d2953347af0e73db371cef49421128b483cecb93
4
+ data.tar.gz: 24b4315f400c88afcd3916548887208b1a10b19a841617df4007beb0280cdf42
5
5
  SHA512:
6
- metadata.gz: 9ddc22c116f93881f4f7c0901ee9e220087e038392238fd4681c899725fcf72836203eafe88a59b2a5f025bc36f3594e743b298a47b5aa1d1ae2ed21ffb1de57
7
- data.tar.gz: a9d5f1aaeddd76c772eacfbcdbaa6404a6edeeef8194a7626252f2df55afc7c08b6c962c64be01139c5c4f1f0609a17a4cd101fca16bff2011ab657b23a52cc8
6
+ metadata.gz: d82d6ded09b50ae677194d3219b3c8d7204f8f18b9ede85431269ff3f677afa205a17ddb20f25760dd35e3d87da35ebac471d86e8d861d0fe5585b4671ddbdc3
7
+ data.tar.gz: b899378707679de0076efdfc1b14a73e781f03216f2ac1391c176567034a436b1074e9f71966e9efb59490442fe22621a3da19481b0397410a1e4bad97657477
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
15
15
  rdoc.rdoc_files.include('lib/**/*.rb')
16
16
  end
17
17
 
18
- APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
19
19
  load 'rails/tasks/engine.rake'
20
20
 
21
21
 
@@ -12,6 +12,7 @@ module ZuoraConnect
12
12
 
13
13
  self.table_name = "zuora_connect_app_instances"
14
14
  attr_accessor :options, :mode, :logins, :task_data, :last_refresh, :username, :password, :s3_client, :api_version, :drop_message, :new_session_message, :connect_user, :logitems, :user_timezone
15
+ @@telegraf_host = nil
15
16
  REFRESH_TIMEOUT = 2.minute #Used to determine how long to wait on current refresh call before executing another
16
17
  INSTANCE_REFRESH_WINDOW = 1.hours #Used to set how how long till app starts attempting to refresh cached task connect data
17
18
  INSTANCE_REDIS_CACHE_PERIOD = 24.hours #Used to determine how long to cached task data will live for
@@ -362,9 +363,9 @@ module ZuoraConnect
362
363
  raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("JSON parse error", response.body, response.code)
363
364
  end
364
365
 
365
- self.build_task(task_data: parsed_json, session: session)
366
+ self.build_task(task_data: parsed_json, session: session)
366
367
  self.set_backup_creds
367
- self.save(validate: false) if self.changed?
368
+ self.save(validate: false) if self.changed?
368
369
  else
369
370
  raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Communicating with Connect", response.body, response.code)
370
371
  end
@@ -412,8 +413,8 @@ module ZuoraConnect
412
413
  def set_backup_creds
413
414
  if self.kms_key.present? && self.kms_key.match(/^arn:aws:.*/) && self.task_data.present?
414
415
  self.zuora_logins = self.strip_cache_data(object: self.task_data.dup, keys: ['applications', 'tokens', 'user_settings'])
415
- end
416
- end
416
+ end
417
+ end
417
418
 
418
419
  def zuora_logins=(val)
419
420
  write_attribute(:zuora_logins, kms_encrypt(val.to_json))
@@ -478,6 +479,15 @@ module ZuoraConnect
478
479
  end
479
480
  Thread.current[:appinstance] = self
480
481
  end
482
+
483
+ def self.write_to_telegraf(*args)
484
+ if ZuoraConnect.configuration.enable_metrics && !defined?(Prometheus)
485
+ @@telegraf_host = ZuoraConnect::Telegraf.new() if @@telegraf_host == nil
486
+ unicorn_stats = ZuoraObservability::Metrics.unicorn_listener if defined?(Unicorn) && Unicorn.respond_to?(:listener_names)
487
+ @@telegraf_host.write(direction: 'Raindrops', tags: {}, values: unicorn_stats) unless unicorn_stats.blank?
488
+ return @@telegraf_host.write(*args)
489
+ end
490
+ end
481
491
  #### END Task Methods ####
482
492
 
483
493
  #### START Task Methods ####
@@ -600,7 +610,10 @@ module ZuoraConnect
600
610
  self.provisioned_app = nil
601
611
  end
602
612
  end
603
- self.save(:validate => false)
613
+ if self.changed?
614
+ self.save(:validate => false)
615
+ self.refresh
616
+ end
604
617
 
605
618
  return parsed_json
606
619
  end
@@ -1029,7 +1042,7 @@ module ZuoraConnect
1029
1042
  catalog_container = catalog_container[object_id]
1030
1043
  end
1031
1044
 
1032
- return catalog_container
1045
+ return catalog_container || {}
1033
1046
  end
1034
1047
 
1035
1048
  if defined?(Redis.current) && object_id.present? && object_id.class == String && object_id.present?
@@ -0,0 +1,73 @@
1
+ module ZuoraConnect
2
+ class Telegraf
3
+ attr_accessor :host
4
+
5
+ OUTBOUND_METRICS = true
6
+ OUTBOUND_METRICS_NAME = "request-outbound"
7
+ INBOUND_METRICS = true
8
+ INBOUND_METRICS_NAME = "request-inbound"
9
+
10
+ def initialize
11
+ self.connect
12
+ end
13
+
14
+ def connect
15
+ ZuoraConnect.logger.debug(self.format_metric_log('Telegraf','Need new connection')) if ZuoraConnect.configuration.telegraf_debug
16
+ uri = URI.parse(ZuoraConnect.configuration.telegraf_endpoint)
17
+ self.host = UDPSocket.new.tap do |socket|
18
+ socket.connect uri.host, uri.port
19
+ end
20
+ rescue => ex
21
+ self.host = nil
22
+ ZuoraConnect.logger.warn(self.format_metric_log('Telegraf', "Failed to connect: #{ex.class}")) if Rails.env.to_s != 'production'
23
+ end
24
+
25
+ def write(direction: 'Unknown', tags: {}, values: {})
26
+ time = Benchmark.measure do |bench|
27
+ # To avoid writing metrics from rspec tests
28
+ if Rails.env.to_sym != :test
29
+ app_instance = Thread.current[:appinstance].present? ? Thread.current[:appinstance].id : 0
30
+ tags = { app_name: ZuoraObservability::Env.app_name, process_type: ZuoraObservability::Env.process_type, app_instance: app_instance, pod_name: ZuoraObservability::Env.pod_name}.merge(tags)
31
+
32
+ if direction == :inbound
33
+ if INBOUND_METRICS && !Thread.current[:inbound_metric].to_bool
34
+ self.write_udp(series: INBOUND_METRICS_NAME, tags: tags, values: values)
35
+ Thread.current[:inbound_metric] = true
36
+ else
37
+ return
38
+ end
39
+ elsif direction == :outbound
40
+ self.write_udp(series: OUTBOUND_METRICS_NAME, tags: tags, values: values) if OUTBOUND_METRICS
41
+ else
42
+ self.write_udp(series: direction, tags: tags, values: values)
43
+ end
44
+ end
45
+ end
46
+ if ZuoraConnect.configuration.telegraf_debug
47
+ ZuoraConnect.logger.debug(self.format_metric_log('Telegraf', tags.to_s))
48
+ ZuoraConnect.logger.debug(self.format_metric_log('Telegraf', values.to_s))
49
+ ZuoraConnect.logger.debug(self.format_metric_log('Telegraf', "Writing '#{direction.capitalize}': #{time.real.round(5)} ms"))
50
+ end
51
+ end
52
+
53
+
54
+ def write_udp(series: '', tags: {}, values: {})
55
+ return if !values.present?
56
+ self.host.write InfluxDB::PointValue.new({series: series, tags: tags, values: values}).dump
57
+ rescue => ex
58
+ self.connect
59
+ ZuoraConnect.logger.warn(self.format_metric_log('Telegraf',"Failed to write udp: #{ex.class}")) if Rails.env.to_s != 'production'
60
+ end
61
+
62
+ def format_metric_log(message, dump = nil)
63
+ message_color, dump_color = "1;91", "0;1"
64
+ log_entry = " \e[#{message_color}m#{message}\e[0m "
65
+ log_entry << "\e[#{dump_color}m%#{String === dump ? 's' : 'p'}\e[0m" % dump if dump
66
+ if Rails.env == :development
67
+ log_entry
68
+ else
69
+ [message, dump].compact.join(' - ')
70
+ end
71
+ end
72
+ end
73
+ end
@@ -26,7 +26,7 @@ module ActiveRecord
26
26
  if oids
27
27
  query += "WHERE t.oid::integer IN (%s)" % oids.join(", ")
28
28
  else
29
- query += initializer.query_conditions_for_initial_load(type_map)
29
+ query += initializer.query_conditions_for_initial_load
30
30
  end
31
31
 
32
32
  execute_and_clear(query, "SCHEMA", []) do |records|
@@ -15,29 +15,6 @@ if defined? Prometheus
15
15
  dir: prometheus_path
16
16
  )
17
17
 
18
- class ResqueExporter
19
- require 'prometheus/client/formats/text'
20
- require 'fileutils'
21
-
22
- def initialize
23
- @lock = Monitor.new
24
- @registry = Prometheus::Client.registry
25
- @path = ENV['RESQUE_EXPORTER_PATH'] || Rails.root.join('tmp/resque_exporter')
26
- FileUtils.mkdir_p(@path)
27
- end
28
-
29
- def export
30
- filename = File.join(@path, 'resque_export.prom')
31
- @lock.synchronize do
32
- File.open(filename, 'w+') do |file|
33
- file.write(Prometheus::Client::Formats::Text.marshal(@registry))
34
- end
35
- end
36
- rescue
37
- # Ignored
38
- end
39
- end
40
-
41
18
  most_recent_aggregation = {}
42
19
  sum_aggregation = {}
43
20
  if defined?(Unicorn)
@@ -5,20 +5,6 @@ if defined?(Resque::Worker)
5
5
  Resque::Job.send(:include, Resque::SelfLookup)
6
6
  end
7
7
 
8
- if defined?(Resque::Job) && defined?(Prometheus)
9
- module ResquePrometheusExtensions
10
- EXPORTER = Prometheus::ResqueExporter.new
11
- def perform
12
- super
13
- EXPORTER.export
14
- end
15
- end
16
-
17
- class Resque::Job
18
- prepend ResquePrometheusExtensions
19
- end
20
- end
21
-
22
8
  Resque.module_eval do
23
9
  # Returns a hash, mapping queue names to queue sizes
24
10
  def queue_sizes
@@ -6,7 +6,7 @@ if defined?(Unicorn::WorkerKiller)
6
6
  if defined?(Prometheus)
7
7
  Prometheus::UNICORN_KILLS.set(1)
8
8
  else
9
- ZuoraObservability::Metrics.write_to_telegraf(direction: 'Unicorn-Killer', tags: {app_instance: 0}, values: {kill: 1})
9
+ ZuoraConnect::AppInstance.write_to_telegraf(direction: 'Unicorn-Killer', tags: {app_instance: 0}, values: {kill: 1})
10
10
  end
11
11
  end
12
12
  end
@@ -0,0 +1,79 @@
1
+ module InfluxDB
2
+ # Convert data point to string using Line protocol
3
+ class PointValue
4
+ attr_reader :series, :values, :tags, :timestamp
5
+
6
+ def initialize(data)
7
+ @series = escape data[:series], :measurement
8
+ @values = escape_values data[:values]
9
+ @tags = escape_tags data[:tags]
10
+ @timestamp = data[:timestamp]
11
+ end
12
+
13
+ def dump
14
+ dump = @series.dup
15
+ dump << ",#{@tags}" if @tags
16
+ dump << " #{@values}"
17
+ dump << " #{@timestamp}" if @timestamp
18
+ dump
19
+ end
20
+
21
+ private
22
+
23
+ ESCAPES = {
24
+ measurement: [' '.freeze, ','.freeze],
25
+ tag_key: ['='.freeze, ' '.freeze, ','.freeze],
26
+ tag_value: ['='.freeze, ' '.freeze, ','.freeze],
27
+ field_key: ['='.freeze, ' '.freeze, ','.freeze, '"'.freeze],
28
+ field_value: ["\\".freeze, '"'.freeze],
29
+ }.freeze
30
+
31
+ private_constant :ESCAPES
32
+
33
+ def escape(str, type)
34
+ # rubocop:disable Layout/AlignParameters
35
+ str = str.encode "UTF-8".freeze, "UTF-8".freeze,
36
+ invalid: :replace,
37
+ undef: :replace,
38
+ replace: "".freeze
39
+ # rubocop:enable Layout/AlignParameters
40
+
41
+ ESCAPES[type].each do |ch|
42
+ str = str.gsub(ch) { "\\#{ch}" }
43
+ end
44
+ str
45
+ end
46
+
47
+ def escape_values(values)
48
+ return if values.nil?
49
+ values.map do |k, v|
50
+ key = escape(k.to_s, :field_key)
51
+ val = escape_value(v)
52
+ "#{key}=#{val}"
53
+ end.join(",".freeze)
54
+ end
55
+
56
+ def escape_value(value)
57
+ if value.is_a?(String)
58
+ '"'.freeze + escape(value, :field_value) + '"'.freeze
59
+ elsif value.is_a?(Integer)
60
+ "#{value}i"
61
+ else
62
+ value.to_s
63
+ end
64
+ end
65
+
66
+ def escape_tags(tags)
67
+ return if tags.nil?
68
+
69
+ tags = tags.map do |k, v|
70
+ key = escape(k.to_s, :tag_key)
71
+ val = escape(v.to_s, :tag_value)
72
+
73
+ "#{key}=#{val}" unless key == "".freeze || val == "".freeze
74
+ end.compact
75
+
76
+ tags.join(",") unless tags.empty?
77
+ end
78
+ end
79
+ end
@@ -68,12 +68,12 @@ class HttpLogger
68
68
  log_request_body(request)
69
69
  log_request_headers(request)
70
70
  if defined?(response) && response
71
- tags = tags.merge({status: response.code.to_i})
71
+ tags = tags.merge({status: response.code.to_i})
72
72
  log_response_code(response)
73
73
  log_response_headers(response)
74
74
  log_response_body(response.body)
75
75
  end
76
- ZuoraObservability::Metrics.write_to_telegraf(direction: :outbound, tags: tags, values: values)
76
+ ZuoraConnect::AppInstance.write_to_telegraf(direction: :outbound, tags: tags, values: values)
77
77
  end
78
78
  end
79
79
 
@@ -95,7 +95,7 @@ class HttpLogger
95
95
  end
96
96
 
97
97
  HTTP_METHODS_WITH_BODY = Set.new(%w(POST PUT GET PATCH))
98
-
98
+
99
99
  def log_request_body(request)
100
100
  if self.class.log_request_body
101
101
  if HTTP_METHODS_WITH_BODY.include?(request.method)
@@ -149,8 +149,8 @@ class HttpLogger
149
149
  def truncate_body(body)
150
150
  if collapse_body_limit && collapse_body_limit > 0 && body && body.size >= collapse_body_limit
151
151
  body_piece_size = collapse_body_limit / 2
152
- body[0..body_piece_size] +
153
- "\n\n<some data truncated>\n\n" +
152
+ body[0..body_piece_size] +
153
+ "\n\n<some data truncated>\n\n" +
154
154
  body[(body.size - body_piece_size)..body.size]
155
155
  else
156
156
  body
@@ -203,7 +203,7 @@ class Net::HTTP
203
203
 
204
204
  def request(request, body = nil, &block)
205
205
  HttpLogger.perform(self, request, body) do
206
- request_without_logging(request, body, &block)
206
+ request_without_logging(request, body, &block)
207
207
  end
208
208
  end
209
209
  end
@@ -215,4 +215,4 @@ if defined?(Rails)
215
215
  HttpLogger.logger = ZuoraConnect.logger unless HttpLogger.logger
216
216
  end
217
217
  end
218
- end
218
+ end
@@ -1,6 +1,37 @@
1
1
  module ZuoraConnect
2
2
  require 'uri'
3
3
 
4
+ # Object of this class is passed to the ActiveSupport::Notification hook
5
+ class PageRequest
6
+
7
+ # This method is triggered when a non error page is loaded (not 404)
8
+ def call(name, started, finished, unique_id, payload)
9
+ # If the url contains any css or JavaScript files then do not collect metrics for them
10
+ return nil if ["css", "assets", "jpg", "png", "jpeg", "ico"].any? { |word| payload[:path].include?(word) }
11
+
12
+ # Getting the endpoint and the content_type
13
+ content_hash = {:html => "text/html", :js => "application/javascript", :json => "application/json", :csv => "text/csv"}
14
+ content_type = content_hash.key?(payload[:format]) ? content_hash[payload[:format]] : payload[:format]
15
+ content_type = content_type.to_s.gsub('text/javascript', 'application/javascript')
16
+
17
+ # payloads with 500 requests do not have status as it is not set by the controller
18
+ # https://github.com/rails/rails/issues/33335
19
+ #status_code = payload[:status] ? payload[:status] : payload[:exception_object].present? ? 500 : ""
20
+ if payload[:exception].present?
21
+ status_code, exception = [500, payload[:exception].first]
22
+ else
23
+ status_code, exception = [payload[:status], nil]
24
+ end
25
+
26
+ tags = {method: payload[:method], status: status_code, error_type: exception, content_type: content_type, controller: payload[:controller], action: payload[:action]}.compact
27
+
28
+ values = {view_time: payload[:view_runtime], db_time: payload[:db_runtime], response_time: ((finished-started)*1000)}.compact
29
+ values = values.map{ |k,v| [k,v.round(2)]}.to_h
30
+
31
+ ZuoraConnect::AppInstanceBase.write_to_telegraf(direction: :inbound, tags: tags, values: values)
32
+ end
33
+ end
34
+
4
35
  class MetricsMiddleware
5
36
 
6
37
  require "zuora_connect/version"
@@ -34,8 +65,11 @@ module ZuoraConnect
34
65
  @bad_headers.each { |header| env.delete(header) }
35
66
 
36
67
  if defined?(Prometheus) && env['PATH_INFO'] == '/connect/internal/metrics'
68
+
37
69
  # Prometheus Stuff
38
70
  metrics = ZuoraObservability::Metrics.resque
71
+ metrics = defined?(ZuoraConnect::AppInstance.get_metrics) ? ZuoraConnect::AppInstance.get_metrics(metrics) : metrics
72
+
39
73
  redis_up = metrics.present? && metrics.dig(:Resque, :Workers_Total).present? ? 1 : 0
40
74
  Prometheus::REDIS_CONNECTION.set(redis_up)
41
75
 
@@ -74,7 +108,7 @@ module ZuoraConnect
74
108
 
75
109
  values = {response_time: ((Time.now - start_time)*1000).round(2) }
76
110
 
77
- ZuoraObservability::Metrics.write_to_telegraf(direction: :inbound, tags: tags, values: values)
111
+ ZuoraConnect::AppInstanceBase.write_to_telegraf(direction: :inbound, tags: tags, values: values)
78
112
  end
79
113
  end
80
114
  Thread.current[:inbound_metric] = nil
@@ -17,9 +17,9 @@ module Resque
17
17
  end
18
18
 
19
19
  begin
20
- connection_count ||= 0
20
+ connection_count ||= 0
21
21
  @appinstance = ZuoraConnect::AppInstance.find(args['app_instance_id'].to_i)
22
- Rails.logger.info('Starting job')
22
+ job_start_log(args)
23
23
 
24
24
  @appinstance.new_session(holding_pattern: true)
25
25
  rescue ActiveRecord::RecordNotFound => exception
@@ -52,12 +52,12 @@ module Resque
52
52
  return
53
53
  rescue ZuoraConnect::Exceptions::ConnectCommunicationError => exception
54
54
  Rails.logger.warn("Enqueue Job Again ~ 2 mins", exception)
55
- @appinstance.queue_pause(time: 2.minutes.to_i)
55
+ @appinstance.queue_pause(time: 2.minutes.to_i)
56
56
  Resque.enqueue_to(self.job.queue, self.job.payload['class'], args)
57
57
  return
58
58
  rescue Net::ReadTimeout, Net::OpenTimeout, Errno::ECONNRESET, Errno::ECONNREFUSED, SocketError => exception
59
59
  Rails.logger.warn("Enqueue Job Again ~ 2 mins", exception)
60
- @appinstance.queue_pause(time: 2.minutes.to_i)
60
+ @appinstance.queue_pause(time: 2.minutes.to_i)
61
61
  Resque.enqueue_to(self.job.queue, self.job.payload['class'], args)
62
62
  return
63
63
  end
@@ -68,6 +68,10 @@ module Resque
68
68
  @appinstance.cache_app_instance if defined?(@appinstance)
69
69
  Rails.logger.flush if Rails.logger.methods.include?(:flush)
70
70
  end
71
+
72
+ def job_start_log(args)
73
+ Rails.logger.info("Starting job")
74
+ end
71
75
  end
72
76
  end
73
- end
77
+ end