spree_cm_commissioner 2.8.0.pre.patch3 → 2.8.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 +4 -4
- data/.env.example +0 -1
- data/Gemfile.lock +1 -1
- data/app/models/spree_cm_commissioner/inventory_item.rb +2 -17
- data/app/models/spree_cm_commissioner/maintenance_tasks/cache_invalidation.rb +0 -2
- data/app/models/spree_cm_commissioner/stock_item_decorator.rb +3 -0
- data/lib/spree_cm_commissioner/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6a112e266f3450b307b12ea0ac4a28a4d5ee9a3eff8e2650d6de5c93c1b73df3
|
|
4
|
+
data.tar.gz: 3285f85273a6c1d19e2eb4b23f087eccca371af1f6cd48282c22042b97d4d8d8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 81c02501bd52647acbc65cc34e6ebcfa309b349a1215a0eadde56101b8d508877cb96e08c044612863ea458be0e70ff018311dc5be59806bc67f97a7cff99061
|
|
7
|
+
data.tar.gz: feb4e3ef254c32769245dd1053ab3ec987f73250db800bd36373bf40e5d9e9ea981586b92a57fbe8bbcfc22ab09bf5cf7343b1a9b8d35bf672e1057510be11ad
|
data/.env.example
CHANGED
|
@@ -34,7 +34,6 @@ DISTANCE_SIGNING_KEY=hei********************VY
|
|
|
34
34
|
|
|
35
35
|
# Cache durations (in seconds) for different content types
|
|
36
36
|
# See: app/controllers/concerns/spree_cm_commissioner/content_cachable.rb
|
|
37
|
-
CACHE_AUTO_INVALIDATION_DISABLED="" # Set to yes to disable CDN cache invalidation entirely (kill switch)
|
|
38
37
|
CACHE_CDN_MAX_AGE=86400 # CDN/server-side cache duration for all responses
|
|
39
38
|
CACHE_STATIC_MAX_AGE=86400 # Static content (countries, provinces, seat layouts, CMS pages) - 1 day
|
|
40
39
|
CACHE_SEMI_STATIC_MAX_AGE=3600 # Semi-static content (menus, homepage backgrounds, routes) - 1 hour
|
data/Gemfile.lock
CHANGED
|
@@ -23,23 +23,8 @@ module SpreeCmCommissioner
|
|
|
23
23
|
|
|
24
24
|
before_save -> { self.product_type = variant.product_type }, if: -> { product_type.nil? }
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
# Only for ecommerce: the app uses product.in_stock? (derived from quantity_available) for product cards.
|
|
29
|
-
# Other types (e.g. accommodation, bus) have many inventory items (including daily-generated ones),
|
|
30
|
-
# so invalidating per item would flood the task queue.
|
|
31
|
-
#
|
|
32
|
-
# This is temporary until we have a more robust cache invalidation strategy in place.
|
|
33
|
-
def schedule_product_cache_invalidation
|
|
34
|
-
return unless ecommerce?
|
|
35
|
-
return unless saved_change_to_quantity_available?
|
|
36
|
-
|
|
37
|
-
# Only fires on in_stock status transition (0 ↔ N); non-zero to non-zero changes are skipped.
|
|
38
|
-
old_val, new_val = saved_change_to_quantity_available
|
|
39
|
-
return if old_val.to_i.positive? && new_val.to_i.positive?
|
|
40
|
-
|
|
41
|
-
SpreeCmCommissioner::MaintenanceTasks::CacheInvalidation.pending.create_or_find_by(maintainable: variant.product)
|
|
42
|
-
end
|
|
26
|
+
# Create maintaining task to purge product related caches
|
|
27
|
+
after_commit { SpreeCmCommissioner::MaintenanceTasks::CacheInvalidation.pending.create_or_find_by(maintainable: variant.product) }
|
|
43
28
|
|
|
44
29
|
def public_quantity_available
|
|
45
30
|
[quantity_available, MAX_DISPLAY_STOCK].min
|
|
@@ -3,8 +3,6 @@ module SpreeCmCommissioner
|
|
|
3
3
|
module MaintenanceTasks
|
|
4
4
|
class CacheInvalidation < MaintenanceTask
|
|
5
5
|
def maintain
|
|
6
|
-
return if ENV['CACHE_AUTO_INVALIDATION_DISABLED'] == 'yes'
|
|
7
|
-
|
|
8
6
|
if maintainable.is_a?(SpreeCmCommissioner::HomepageBackground) || maintainable.is_a?(Spree::Menu)
|
|
9
7
|
SpreeCmCommissioner::HomepageDataLoader.clear_cache
|
|
10
8
|
end
|
|
@@ -6,6 +6,9 @@ module SpreeCmCommissioner
|
|
|
6
6
|
|
|
7
7
|
base.after_commit :create_inventory_items, on: :create
|
|
8
8
|
base.after_commit :adjust_inventory_items_async, on: :destroy
|
|
9
|
+
|
|
10
|
+
# Create maintaining task to purge product related caches
|
|
11
|
+
base.after_commit { SpreeCmCommissioner::MaintenanceTasks::CacheInvalidation.pending.create_or_find_by(maintainable: variant.product) }
|
|
9
12
|
end
|
|
10
13
|
|
|
11
14
|
def update_vendor_total_inventory
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_cm_commissioner
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.8.0
|
|
4
|
+
version: 2.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- You
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: spree
|
|
@@ -3360,9 +3360,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
3360
3360
|
version: '2.7'
|
|
3361
3361
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
3362
3362
|
requirements:
|
|
3363
|
-
- - "
|
|
3363
|
+
- - ">="
|
|
3364
3364
|
- !ruby/object:Gem::Version
|
|
3365
|
-
version:
|
|
3365
|
+
version: '0'
|
|
3366
3366
|
requirements:
|
|
3367
3367
|
- none
|
|
3368
3368
|
rubygems_version: 3.4.1
|