spree_cm_commissioner 2.8.4.pre.pre5 → 2.8.4
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: b0a4ffeafedfee096e97e6b76497164146a69fca87cbc28a16309b08c018c079
|
|
4
|
+
data.tar.gz: 70d303ce8d2d1e66425c106ede7fd7ae81bbefa355027bbca0a570e996466ebd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 134937bcd74efecb6a2d3a0a23c77f358d16fd00e3100dd28f88a52435fe92afd1ac480674c8f5babe379e42898fa497dd7e1966836c091fd9bfa02465b96080
|
|
7
|
+
data.tar.gz: a810dac72b6fddce0c15f422c7b082e63f522bdefbf4893694204462109de870e56dabc9d49e4c0d3eb8fb58127dae673f184b173885e40aea6a9c0b6e1e2c66
|
|
@@ -163,8 +163,10 @@ jobs:
|
|
|
163
163
|
- name: Security
|
|
164
164
|
env:
|
|
165
165
|
DATABASE_URL: postgres://myuser:mypassword@localhost:5432/test_db
|
|
166
|
+
|
|
167
|
+
# Using --no-threads to bypass a known Ruby 3.2.0 GC segmentation fault in CI.
|
|
166
168
|
run: |
|
|
167
|
-
bundle exec brakeman --no-exit-on-warn
|
|
169
|
+
bundle exec brakeman --no-threads --no-exit-on-warn
|
|
168
170
|
|
|
169
171
|
test:
|
|
170
172
|
needs: [setup]
|
data/Gemfile.lock
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
require 'google/cloud/firestore'
|
|
2
|
+
require 'zlib'
|
|
2
3
|
|
|
3
4
|
module SpreeCmCommissioner
|
|
4
5
|
class WaitingRoomSessionCreator < BaseInteractor
|
|
5
6
|
delegate :remote_ip, :waiting_guest_firebase_doc_id, :page_path, :tenant_id, to: :context
|
|
6
7
|
|
|
7
|
-
SESSION_CREATION_LOCK_KEY =
|
|
8
|
+
SESSION_CREATION_LOCK_KEY = 'waiting_room_session_creation'.freeze
|
|
8
9
|
|
|
9
10
|
def call
|
|
10
11
|
return context.fail!(message: 'must_provide_waiting_guest_firebase_doc_id') if waiting_guest_firebase_doc_id.blank?
|
|
11
12
|
return context.fail!(message: 'must_provide_remote_ip') if remote_ip.blank?
|
|
12
13
|
|
|
13
14
|
# Advisory lock ensures the capacity check and session creation are atomic across all app instances.
|
|
14
|
-
|
|
15
|
+
advisory_lock(SESSION_CREATION_LOCK_KEY) do
|
|
15
16
|
return context.fail!(message: 'sessions_reach_it_maximum') if full?
|
|
16
17
|
|
|
17
18
|
generate_jwt_token
|
|
@@ -35,9 +36,10 @@ module SpreeCmCommissioner
|
|
|
35
36
|
SpreeCmCommissioner::WaitingRoomSession.active.count >= max
|
|
36
37
|
end
|
|
37
38
|
|
|
38
|
-
def
|
|
39
|
+
def advisory_lock(lock_key)
|
|
40
|
+
lock_id = Zlib.crc32(lock_key)
|
|
39
41
|
SpreeCmCommissioner::WaitingRoomSession.transaction do
|
|
40
|
-
SpreeCmCommissioner::WaitingRoomSession.connection.execute("SELECT pg_advisory_xact_lock(#{
|
|
42
|
+
SpreeCmCommissioner::WaitingRoomSession.connection.execute("SELECT pg_advisory_xact_lock(#{lock_id})")
|
|
41
43
|
yield
|
|
42
44
|
end
|
|
43
45
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_cm_commissioner
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.8.4
|
|
4
|
+
version: 2.8.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- You
|
|
@@ -3457,9 +3457,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
3457
3457
|
version: '2.7'
|
|
3458
3458
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
3459
3459
|
requirements:
|
|
3460
|
-
- - "
|
|
3460
|
+
- - ">="
|
|
3461
3461
|
- !ruby/object:Gem::Version
|
|
3462
|
-
version:
|
|
3462
|
+
version: '0'
|
|
3463
3463
|
requirements:
|
|
3464
3464
|
- none
|
|
3465
3465
|
rubygems_version: 3.4.1
|