forest_admin_datasource_rpc 1.25.1 → 1.25.2
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 422ac8ba74ee59856552a1f656b97504649adc5b9c7d5413b8a3ef8c48cce2b3
|
|
4
|
+
data.tar.gz: fcfd326aae52472ffb1b26761538e1e949487c87cf4e5f0bb15c4720618cc759
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a945b6fab5fcb635b8a4b5b225772452a497d354ddf51e93b00fa65795b27c0b5fde4e66ca6d6b26aff5fa31c899e5cbb26cbe70e48eaed52ffdea83f0447344
|
|
7
|
+
data.tar.gz: b45a7255c3d14d28d5426d8a7869755d8f174b5c95225c205fa275346f5532d40cfb7132f43bd2442cf69606a6e4bd4d5929657a517c732bfec666ee084f599d
|
|
@@ -63,6 +63,22 @@ module ForestAdminDatasourceRpc
|
|
|
63
63
|
ForestAdminDatasourceToolkit::Utils::HashHelper.convert_keys(result.to_a)
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
+
def refresh!(new_schema)
|
|
67
|
+
# Replace collections with those from the new schema
|
|
68
|
+
@collections = {}
|
|
69
|
+
new_schema[:collections].each do |collection|
|
|
70
|
+
add_collection(Collection.new(self, collection[:name], collection))
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
@charts = new_schema[:charts]
|
|
74
|
+
@rpc_relations = new_schema[:rpc_relations]
|
|
75
|
+
|
|
76
|
+
native_query_connections = new_schema[:native_query_connections] || []
|
|
77
|
+
@live_query_connections = native_query_connections.to_h { |conn| [conn[:name], conn[:name]] }
|
|
78
|
+
|
|
79
|
+
@schema = { charts: @charts }
|
|
80
|
+
end
|
|
81
|
+
|
|
66
82
|
def cleanup
|
|
67
83
|
return if @cleaned_up
|
|
68
84
|
|
|
@@ -35,16 +35,19 @@ module ForestAdminDatasourceRpc
|
|
|
35
35
|
# Auto-configure pool with default settings if not already configured
|
|
36
36
|
ensure_pool_configured
|
|
37
37
|
|
|
38
|
+
datasource_ref = nil
|
|
39
|
+
|
|
38
40
|
schema_polling = Utils::SchemaPollingClient.new(
|
|
39
41
|
uri,
|
|
40
42
|
auth_secret,
|
|
41
43
|
polling_interval: polling_interval,
|
|
42
44
|
introspection: provided_introspection
|
|
43
|
-
) do
|
|
45
|
+
) do |new_schema|
|
|
44
46
|
Thread.new do
|
|
45
47
|
logger = ForestAdminAgent::Facades::Container.logger
|
|
46
48
|
logger.log('Info', '[RPCDatasource] Schema change detected, reloading agent in background...')
|
|
47
49
|
begin
|
|
50
|
+
datasource_ref&.refresh!(new_schema)
|
|
48
51
|
ForestAdminAgent::Builder::AgentFactory.instance.reload!
|
|
49
52
|
logger.log('Info', '[RPCDatasource] Agent reload completed successfully')
|
|
50
53
|
rescue StandardError => e
|
|
@@ -65,7 +68,7 @@ module ForestAdminDatasourceRpc
|
|
|
65
68
|
end
|
|
66
69
|
|
|
67
70
|
options.delete(:introspection)
|
|
68
|
-
ForestAdminDatasourceRpc::Datasource.new(options, schema, schema_polling)
|
|
71
|
+
datasource_ref = ForestAdminDatasourceRpc::Datasource.new(options, schema, schema_polling)
|
|
69
72
|
end
|
|
70
73
|
|
|
71
74
|
def self.ensure_pool_configured
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forest_admin_datasource_rpc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.25.
|
|
4
|
+
version: 1.25.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthieu
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-03-
|
|
12
|
+
date: 2026-03-06 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: base64
|