thecore_background_jobs 2.2.2 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fdcf9fcab7f49e5727cf2d642b3ebe71816f57a56ee584845924309dc52c7b21
4
- data.tar.gz: 875489c8fe83a696dbd424e91cbefb84f0aed584e8152595c069cf45da4b3675
3
+ metadata.gz: 2c9c5ce397743040c676c50e2ff7526b52e8a59dfce3944244ac747b675a8edf
4
+ data.tar.gz: 79cb52050b3a2fb7933e71e2e44df1222e85473a73cedc94528498a8c45ea543
5
5
  SHA512:
6
- metadata.gz: 648ba26852bad9f5755dfa938c7fce6bd3540759a42652cdfdb221277ea5ab3090511d79bd6e7135ee333e9d2e243af0a2c3415d0bc9cf0ad94f6b73b3e0f15e
7
- data.tar.gz: af665f56da46427959900d768bc831088fef8419b1e5ed049640ad9d045402dc9653456e215f03c74da77fa786c8a893532843c8abf39b9da0933f8df0c4b5a1
6
+ metadata.gz: c4c1cbd68f019f47a0e1a1274e3c7b9fe57b486a2d5ea56d1b77ac135a402e58a63a699ad050a9d91286498c1bb48f689b8567883707f38c0e9a2425a1db1fe6
7
+ data.tar.gz: 103d8b64ed5dc79632d8394c9b2751567250c99592899e41b524c7cef0d0643e735f204d673be40cfd2eef961082a5b2e8c4ee88774b85e3d6cc21429f808494
@@ -23,38 +23,27 @@ module ThecoreBackgroundJobs
23
23
  # }
24
24
  begin
25
25
  Sidekiq.get_all_schedules.each_pair do |key, config|
26
- puts "Key: #{key}, Config: #{config}"
26
+ Rails.logger.info "Key: #{key}, Config: #{config}"
27
27
  schedule = "cron_for_#{key.underscore}"
28
28
  setting = ThecoreSettings::Setting.where(ns: "schedules", key: schedule).pluck(:raw).first
29
- puts "Setting is #{schedule} = #{setting}"
29
+ Rails.logger.info "Setting is #{schedule} = #{setting}"
30
30
  # Installing initial sidekiq.yml configuration if setting is not present
31
31
  if setting.blank?
32
- puts "Setting #{schedule} doesn't exist, creating based on current value: #{config["cron"]}"
32
+ Rails.logger.info "Setting #{schedule} doesn't exist, creating based on current value: #{config["cron"]}"
33
33
  ThecoreSettings::Setting.create(ns: "schedules", key: schedule, raw: config["cron"])
34
34
  # Settings.ns("schedules").send("#{schedule}=", config["cron"])
35
35
  elsif config["cron"].squeeze(" ").strip != setting.squeeze(" ").strip
36
36
  # If we have a setting and is different from the currently loaded, then replace it
37
37
  # in scheduler configuration
38
- puts "Setting #{schedule} exists: #{setting}"
39
- Sidekiq.set_schedule(key.underscore, { cron: setting.squeeze(" ").strip, queue: "#{ENV["COMPOSE_PROJECT_NAME"]}_default", class: key })
40
- puts "Reloading schedules"
38
+ Rails.logger.info "Setting #{schedule} exists: #{setting}"
39
+ Sidekiq.set_schedule(key, { cron: setting.squeeze(" ").strip, queue: "#{ENV["COMPOSE_PROJECT_NAME"]}_default", class: key })
40
+ Rails.logger.info "Reloading schedules"
41
41
  SidekiqScheduler::Scheduler.instance.reload_schedule!
42
42
  end
43
43
  end
44
44
  rescue => exception
45
- puts "Thecore Background Jobs: REDIS not reachable:"
46
- puts exception.message
45
+ Rails.logger.info "Thecore Background Jobs: REDIS not reachable:"
46
+ Rails.logger.info exception.message
47
47
  end
48
- # check_in_stock_parcels = ThecoreSettings::Setting.where(ns: "schedules", key: "cron_for_check_in_stock_parcels").pluck(:raw).first
49
- # unless check_in_stock_parcels.blank?
50
- # begin
51
- # puts "Setting the schedule during initialization"
52
- # Sidekiq.set_schedule('check_in_stock_parcels', { cron: check_in_stock_parcels, queue: "#{ENV["COMPOSE_PROJECT_NAME"]}_default", class: 'ScheduleEmployeeReminderForInStockParcelsJob' })
53
- # puts "Reloading schedules during initialization"
54
- # SidekiqScheduler::Scheduler.instance.reload_schedule!
55
- # rescue => exception
56
- # puts exception.message
57
- # end
58
- # end
59
48
  end
60
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_background_jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni