graphiti 1.6.1 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/graphiti/configuration.rb +0 -15
- data/lib/graphiti/scope.rb +1 -18
- data/lib/graphiti/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9fe56af10e2f476d55ff2d367e4efd0841f73afbe4d4f95cae0f9ab81f6a39e
|
4
|
+
data.tar.gz: 4d3037e59ed89ed1bfb5bd4af49d6cd80038661907d8983ecfd5a17afa96c061
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f09aeaedda7fc10d97270fe89789fb1b038a2efe4615136fe1ccc576059c5af4b57c9bf97a0f79e38d240ba44f99b4d31f662b27a7d7f3128622bb8ae60429ef
|
7
|
+
data.tar.gz: 5c965ae2e16ceb97a7e2aa5341cff1e039a8f43d17c2766c884adfb9b0f1ae16fd5df16f1ca7973b3b27face19f80a6e541c43558f9dfbaedf72909b6ae8c361
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
graphiti changelog
|
2
2
|
|
3
|
+
## [1.6.3](https://github.com/graphiti-api/graphiti/compare/v1.6.2...v1.6.3) (2024-03-26)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* Remove thread pool executor logic until we get a better handle on what's causing thread pool hangs. refs [#469](https://github.com/graphiti-api/graphiti/issues/469) ([7941b6f](https://github.com/graphiti-api/graphiti/commit/7941b6f75ce1001b034ed6e83c148b893e9f3d99)), closes [#471](https://github.com/graphiti-api/graphiti/issues/471) [#470](https://github.com/graphiti-api/graphiti/issues/470)
|
9
|
+
|
10
|
+
## [1.6.2](https://github.com/graphiti-api/graphiti/compare/v1.6.1...v1.6.2) (2024-03-22)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* thread pool scope and mutex need to be global across all instances of Scope for it to be a global thread pool ([#471](https://github.com/graphiti-api/graphiti/issues/471)) ([51fb51c](https://github.com/graphiti-api/graphiti/commit/51fb51c31f0043d98aa07f689a8cf8c758fa823b))
|
16
|
+
|
3
17
|
## [1.6.1](https://github.com/graphiti-api/graphiti/compare/v1.6.0...v1.6.1) (2024-03-22)
|
4
18
|
|
5
19
|
|
@@ -8,20 +8,6 @@ module Graphiti
|
|
8
8
|
# Defaults to false OR if classes are cached (Rails-only)
|
9
9
|
attr_accessor :concurrency
|
10
10
|
|
11
|
-
# This number must be considered in accordance with the database
|
12
|
-
# connection pool size configured in `database.yml`. The connection
|
13
|
-
# pool should be large enough to accommodate both the foreground
|
14
|
-
# threads (ie. web server or job worker threads) and background
|
15
|
-
# threads. For each process, Graphiti will create one global
|
16
|
-
# executor that uses this many threads to sideload resources
|
17
|
-
# asynchronously. Thus, the pool size should be at least
|
18
|
-
# `thread_count + concurrency_max_threads + 1`. For example, if your
|
19
|
-
# web server has a maximum of 3 threads, and
|
20
|
-
# `concurrency_max_threads` is set to 4, then your pool size should
|
21
|
-
# be at least 8.
|
22
|
-
# @return [Integer] Maximum number of threads to use when fetching sideloads concurrently
|
23
|
-
attr_accessor :concurrency_max_threads
|
24
|
-
|
25
11
|
attr_accessor :respond_to
|
26
12
|
attr_accessor :context_for_endpoint
|
27
13
|
attr_accessor :links_on_demand
|
@@ -40,7 +26,6 @@ module Graphiti
|
|
40
26
|
def initialize
|
41
27
|
@raise_on_missing_sideload = true
|
42
28
|
@concurrency = false
|
43
|
-
@concurrency_max_threads = 4
|
44
29
|
@respond_to = [:json, :jsonapi, :xml]
|
45
30
|
@links_on_demand = false
|
46
31
|
@pagination_links_on_demand = false
|
data/lib/graphiti/scope.rb
CHANGED
@@ -2,23 +2,6 @@ module Graphiti
|
|
2
2
|
class Scope
|
3
3
|
attr_accessor :object, :unpaginated_object
|
4
4
|
attr_reader :pagination
|
5
|
-
|
6
|
-
@thread_pool_executor_mutex = Mutex.new
|
7
|
-
|
8
|
-
def self.thread_pool_executor
|
9
|
-
return @thread_pool_executor if @thread_pool_executor
|
10
|
-
|
11
|
-
concurrency = Graphiti.config.concurrency_max_threads || 4
|
12
|
-
@thread_pool_executor ||= @thread_pool_executor_mutex.synchronize do
|
13
|
-
Concurrent::ThreadPoolExecutor.new(
|
14
|
-
min_threads: 0,
|
15
|
-
max_threads: concurrency,
|
16
|
-
max_queue: concurrency * 4,
|
17
|
-
fallback_policy: :caller_runs
|
18
|
-
)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
5
|
def initialize(object, resource, query, opts = {})
|
23
6
|
@object = object
|
24
7
|
@resource = resource
|
@@ -66,7 +49,7 @@ module Graphiti
|
|
66
49
|
@resource.adapter.close if concurrent
|
67
50
|
}
|
68
51
|
if concurrent
|
69
|
-
promises << Concurrent::Promise.execute(
|
52
|
+
promises << Concurrent::Promise.execute(&resolve_sideload)
|
70
53
|
else
|
71
54
|
resolve_sideload.call
|
72
55
|
end
|
data/lib/graphiti/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|