judoscale-ruby 1.8.3 → 1.9.0

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: b7891f9296093834a1c5d414f0a30010dd20aa8183250d9e7431ae6d821051c2
4
- data.tar.gz: 71c7009f8e56e243d111164fe1897113d7afea21afb327f2a0b079143d404115
3
+ metadata.gz: 89e1c234767f82a457f3e3d9ddc185fb7229e0f4e8de84fd9861c51c07e27b9c
4
+ data.tar.gz: 3f899a16cb1454e3720468702db0401c17f684a5b8d7263b3830e97038cfea37
5
5
  SHA512:
6
- metadata.gz: 45dfc849ae8b813bdf3c78745074423b92c686ba901c9523f1072fea39600ce3554fe054d69a626b107a9e5b88930a212470ba4b1aa253e81fb18284787a5c7e
7
- data.tar.gz: 7f8991a523ee1131e2939605fe3d50acfb00cf5bcd075055d49cbe31ded4234df8b3a278e38fccbb060e6884cd36983b4314503263c8c65f8fa9c625d0dca8a3
6
+ metadata.gz: 8183357c4717a609224e3bf8a15ef567d19e71d1b5de1027faa25e0480af7870eb44290a02929352a29d1c5b8581345218cc1bdd264ccf5cdf91eae0e5fa5ede
7
+ data.tar.gz: 71b1c714b3c1979394d39237873c28f40c2881151c53fac0f23a42d225686d3f76f31a10bbf792d6f31aac0e40a6d2e32eb064bb156cbbb9aeee9fa92a29dfc5
@@ -93,20 +93,24 @@ module Judoscale
93
93
 
94
94
  self.class.adapter_configs.each(&:reset)
95
95
 
96
- if ENV["RENDER_INSTANCE_ID"]
97
- instance = ENV["RENDER_INSTANCE_ID"].delete_prefix(ENV["RENDER_SERVICE_ID"]).delete_prefix("-")
98
- @current_runtime_container = RuntimeContainer.new instance
99
- # Allow a custom API base URL to be set for Render (for testing)
100
- @api_base_url ||= "https://adapter.judoscale.com/api"
101
- @api_base_url += "/#{ENV["RENDER_SERVICE_ID"]}"
102
- elsif ENV["DYNO"]
103
- @current_runtime_container = RuntimeContainer.new ENV["DYNO"]
104
- elsif (metadata_uri = ENV["ECS_CONTAINER_METADATA_URI"])
105
- @current_runtime_container = RuntimeContainer.new(metadata_uri.split("/").last)
106
- else
107
- # unsupported platform? Don't want to leave @current_runtime_container nil though
108
- @current_runtime_container = RuntimeContainer.new("")
109
- end
96
+ @current_runtime_container =
97
+ if ENV.include?("DYNO")
98
+ RuntimeContainer.new ENV["DYNO"]
99
+ elsif ENV.include?("RENDER_INSTANCE_ID")
100
+ # Deprecated API url using the service ID for legacy render services not using `JUDOSCALE_URL`.
101
+ @api_base_url ||= "https://adapter.judoscale.com/api/#{ENV["RENDER_SERVICE_ID"]}"
102
+
103
+ instance = ENV["RENDER_INSTANCE_ID"].delete_prefix("#{ENV["RENDER_SERVICE_ID"]}-")
104
+ RuntimeContainer.new instance
105
+ elsif ENV.include?("ECS_CONTAINER_METADATA_URI")
106
+ instance = ENV["ECS_CONTAINER_METADATA_URI"].split("/").last
107
+ RuntimeContainer.new instance
108
+ elsif ENV.include?("RAILWAY_REPLICA_ID")
109
+ RuntimeContainer.new ENV["RAILWAY_REPLICA_ID"]
110
+ else
111
+ # Unsupported platform...
112
+ RuntimeContainer.new("")
113
+ end
110
114
  end
111
115
 
112
116
  def log_level=(new_level)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Judoscale
4
- VERSION = "1.8.3"
4
+ VERSION = "1.9.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judoscale-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.3
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam McCrea
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-12-30 00:00:00.000000000 Z
13
+ date: 2025-01-17 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description:
16
16
  email: