business_flow 0.19.0 → 0.19.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/business_flow/cacheable.rb +21 -0
- data/lib/business_flow/cluster_lock.rb +8 -0
- data/lib/business_flow/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: 594752766329fcaa20e52b6b17f3a0b864fb893453055d24dd8596e0a3f5dac5
|
4
|
+
data.tar.gz: c4c8a27b23c2bfdd63378d9a3da1f47e3f9c9f1e0b95eb7344575c30ef2651d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ac739ddbf16363e5d6397be8720205187a9ccaa043a11b26e67ccc33f72f83d354c713d2359ffec27bb8a2c9cd93422922aee25aefcec424cc4bc3c5f76226c
|
7
|
+
data.tar.gz: be38502bd0d953729bb48b723540dbc2288f5cd7eb56c5ef54e60854de6c2a4d185604f3d84c681c36906658058863d18ff86eb7a20144ee4a8d1d86fb033f40
|
data/Gemfile.lock
CHANGED
@@ -66,6 +66,27 @@ module BusinessFlow
|
|
66
66
|
Callable.new(:_business_flow_dsl_parameters)
|
67
67
|
end
|
68
68
|
|
69
|
+
def clear_cache(parameter_object = {})
|
70
|
+
clear_cache!(parameter_object)
|
71
|
+
rescue FlowFailedException => exc
|
72
|
+
exc.flow
|
73
|
+
end
|
74
|
+
|
75
|
+
def clear_cache!(parameter_object = {})
|
76
|
+
flow = build(parameter_object)
|
77
|
+
raise FlowFailedException, result_from(flow) if flow.errors?
|
78
|
+
ClassMethods.clear_cache(flow)
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.clear_cache(flow)
|
82
|
+
klass = flow.class
|
83
|
+
klass.instrument(:clear_cache, flow) do |payload|
|
84
|
+
ret = klass.cache_store.delete(flow.cache_key)
|
85
|
+
payload[:cache_clear] = ret if payload
|
86
|
+
ret
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
69
90
|
def execute(flow)
|
70
91
|
with_cache(flow) do
|
71
92
|
super(flow)._business_flow_cacheable_finalize(flow.cache_key)
|
@@ -40,6 +40,14 @@ module BusinessFlow
|
|
40
40
|
raise
|
41
41
|
end
|
42
42
|
|
43
|
+
def read_attribute_for_validation(key)
|
44
|
+
if key == :cluster_lock
|
45
|
+
ClassMethods.lock_name(self)
|
46
|
+
else
|
47
|
+
super(key)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
43
51
|
# DSL Methods
|
44
52
|
module ClassMethods
|
45
53
|
# Error raised when there is an internal issue with acquiring a lock.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: business_flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.19.
|
4
|
+
version: 0.19.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Scarborough
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|