forest_admin_agent 1.8.9 → 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: 7b0dea02691148f9328f2e8544a53ac5bbaba9c88b5c5d88548cd232f60d7914
4
- data.tar.gz: bb591c88ef30c293d9d38df74ee2a035f2c887608573a84bf64445ade3de73c1
3
+ metadata.gz: db02d65763186ba3ebdb9a253ca60c7a292c00f4b52d54e841be1ab4cd05702b
4
+ data.tar.gz: 87bd836d1d1f461d7aed416d8bb43397067f1575331974df1ac59ec32bbb415d
5
5
  SHA512:
6
- metadata.gz: 9d8fc038e89c10096471e3978ad9dc51f3433d3f0c82bb766548bd9ad44aa99fca2d393647f5814501f1768b32e4146c952e3cb5ca49ef63315ee74ff161c90b
7
- data.tar.gz: 661d0efdaedc34899c77b9e703e36bf1eb884b79931ae8ecdb53d4bc10dc6f94c48f4cc3910ce0d78da93e485ce4027d85a1f2836bc7ac6dd7ace434bc886457
6
+ metadata.gz: 241d1f8f861ed041334c14713018b0c0609d4193e4821c1d517975b1e780b57fc5e606fae505799f73393b700117e17cc53b8218b1a6595d71d238fc9d887cda
7
+ data.tar.gz: 434548e00921d627fa800d10834980476afaf3bd3a3ef5e2e80bca7bd64263622284bae86c28449b3708ac507847ff8326c6029163164930564da7fd601eb385
@@ -62,6 +62,11 @@ module ForestAdminAgent
62
62
  end
63
63
 
64
64
  def send_schema(force: false)
65
+ if should_skip_schema_update? && !force
66
+ log_schema_skip
67
+ return
68
+ end
69
+
65
70
  return unless @has_env_secret
66
71
 
67
72
  schema_path = Facades::Container.cache(:schema_path)
@@ -160,6 +165,17 @@ module ForestAdminAgent
160
165
  cleaned_option = source&.strip if source
161
166
  cleaned_option&.delete_prefix(prefix)&.strip
162
167
  end
168
+
169
+ def should_skip_schema_update?
170
+ Facades::Container.cache(:skip_schema_update) == true
171
+ end
172
+
173
+ def log_schema_skip
174
+ @logger.log('Warn', '[ForestAdmin] Schema update skipped (skip_schema_update flag is true)')
175
+ environment = Facades::Container.cache(:is_production) ? 'production' : 'development'
176
+ @logger.log('Info',
177
+ "[ForestAdmin] Running in #{environment} mode")
178
+ end
163
179
  end
164
180
  end
165
181
  end
@@ -10,10 +10,6 @@ module ForestAdminAgent
10
10
  end
11
11
 
12
12
  def handle_request(_args = {})
13
- if AgentFactory.instance.container.resolve(:cache).get('config')[:is_production]
14
- AgentFactory.instance.send_schema(force: true)
15
- end
16
-
17
13
  { content: nil, status: 204 }
18
14
  end
19
15
  end
@@ -6,7 +6,7 @@ module ForestAdminAgent
6
6
  module Schema
7
7
  class SchemaEmitter
8
8
  LIANA_NAME = "agent-ruby"
9
- LIANA_VERSION = "1.8.9"
9
+ LIANA_VERSION = "1.9.0"
10
10
 
11
11
  def self.generate(datasource)
12
12
  datasource.collections
@@ -1,3 +1,3 @@
1
1
  module ForestAdminAgent
2
- VERSION = "1.8.9"
2
+ VERSION = "1.9.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.9
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu