ask-state-providers 0.4.4 → 0.4.5
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 +4 -4
- data/lib/ask/state/providers/postgres.rb +15 -0
- data/lib/ask/state/providers/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 39454f2f084a68e8741e42372f9fd84bb42764dd943788ad90705753b985bb56
|
|
4
|
+
data.tar.gz: 1fc9f522ab52cfbfa6757f0b519e61c4d5eef53ebdec2e3a99fef266b461a309
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e60207c2814ac955f0c2137966bb0a01b0bdf3743afc4441ee07a04a5e930584a773085a83c0883f963830e312525dc01ce262510b17e5fee73a7ab04104690a
|
|
7
|
+
data.tar.gz: 26534c8ede214627d96f80e5eb83622c455c1c2ef9ed521dd306f683a791cd19bb92e9577de91f910d1d0361386ea101388135f6ea38db671cc06a93ec98535a
|
|
@@ -60,6 +60,13 @@ module Ask
|
|
|
60
60
|
# @param pool_size [Integer] connection pool size (default 5)
|
|
61
61
|
def initialize(url: ENV.fetch("DATABASE_URL", "postgres://localhost:5432/ask_state"),
|
|
62
62
|
pool_size: 5)
|
|
63
|
+
# On macOS, libpq's default GSSAPI negotiation can segfault
|
|
64
|
+
# when a forked process (SolidQueue worker) opens a fresh
|
|
65
|
+
# connection — the same crash the sibling apps guard with
|
|
66
|
+
# `gssencmode: disable` in database.yml. The store connects
|
|
67
|
+
# directly (not through ActiveRecord), so the guard lives here.
|
|
68
|
+
url = self.class.darwin_safe_url(url) if RUBY_PLATFORM =~ /darwin/
|
|
69
|
+
|
|
63
70
|
@pool = ConnectionPool.new(size: pool_size) do
|
|
64
71
|
::PG.connect(url)
|
|
65
72
|
end
|
|
@@ -67,6 +74,14 @@ module Ask
|
|
|
67
74
|
migrate
|
|
68
75
|
end
|
|
69
76
|
|
|
77
|
+
# Append gssencmode=disable to a URL on macOS (idempotent).
|
|
78
|
+
def self.darwin_safe_url(url)
|
|
79
|
+
return url if url.include?("gssencmode")
|
|
80
|
+
|
|
81
|
+
separator = url.include?("?") ? "&" : "?"
|
|
82
|
+
"#{url}#{separator}gssencmode=disable"
|
|
83
|
+
end
|
|
84
|
+
|
|
70
85
|
# -- key-value --
|
|
71
86
|
|
|
72
87
|
def get(key)
|