gdpr_admin 1.8.1 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/app/models/gdpr_admin/request.rb +9 -2
- data/lib/gdpr_admin/configuration.rb +2 -1
- data/lib/gdpr_admin/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: 9f2e3eb2d8eea4c910112fa0ca7c4fd4ac77816137321022205684a583086315
|
4
|
+
data.tar.gz: 9ac8e526d9a38a54a88557a58cee645aa0a80aa2362fe01dfbd41f719440ae67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d320fa119e9adecadce0703e19655a8267e11b159a8f5da6854fa939cc2c6002c0290b12b4f1729f21cbcfe82de098e540156165358b925ae6133c9ae11350e8
|
7
|
+
data.tar.gz: f4ef6c026b32d33c9f05bd0dca8b1ec2ded1b66f22e7f477a874418bf4dbefac918c4ec3926e96cf483ff3fe19be12274a15791e994c6310928f2223c5727dbf
|
data/README.md
CHANGED
@@ -382,6 +382,15 @@ GdprAdmin.configure do |config|
|
|
382
382
|
end
|
383
383
|
```
|
384
384
|
|
385
|
+
#### Rollback on Failure
|
386
|
+
By default, GDPR Admin will attempt to rollback all changes made during the processing a Request in case it fails during the processing. This can be turned of with the flag `rollback_on_failure`. In this situation, all changes will be committed as soon as they are done.
|
387
|
+
|
388
|
+
```ruby
|
389
|
+
GdprAdmin.configure do |config|
|
390
|
+
config.rollback_on_failure = false
|
391
|
+
end
|
392
|
+
```
|
393
|
+
|
385
394
|
### Jobs
|
386
395
|
Requests are processed asynchronously using ActiveJob.
|
387
396
|
|
@@ -41,8 +41,8 @@ module GdprAdmin
|
|
41
41
|
|
42
42
|
def process!
|
43
43
|
GdprAdmin.load_data_policies
|
44
|
-
reload.
|
45
|
-
|
44
|
+
reload.lock_strategy { processing! }
|
45
|
+
lock_strategy do
|
46
46
|
process_policies
|
47
47
|
completed!
|
48
48
|
end
|
@@ -67,6 +67,13 @@ module GdprAdmin
|
|
67
67
|
RequestProcessorJob.set(wait: grace_period).perform_later(self)
|
68
68
|
end
|
69
69
|
|
70
|
+
def lock_strategy(&block)
|
71
|
+
return with_lock(&block) if GdprAdmin.config.rollback_on_failure
|
72
|
+
return with_advisory_lock(to_global_id.to_s, &block) if respond_to?(:with_advisory_lock)
|
73
|
+
|
74
|
+
yield
|
75
|
+
end
|
76
|
+
|
70
77
|
private
|
71
78
|
|
72
79
|
def grace_period
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module GdprAdmin
|
4
4
|
class Configuration
|
5
5
|
attr_accessor :tenant_class, :data_policies_path, :default_job_queue,
|
6
|
-
:erasure_grace_period, :export_grace_period
|
6
|
+
:erasure_grace_period, :export_grace_period, :rollback_on_failure
|
7
7
|
attr_writer :tenant_adapter
|
8
8
|
|
9
9
|
def initialize
|
@@ -13,6 +13,7 @@ module GdprAdmin
|
|
13
13
|
@default_job_queue = :default
|
14
14
|
@erasure_grace_period = 4.hours
|
15
15
|
@export_grace_period = nil
|
16
|
+
@rollback_on_failure = true
|
16
17
|
end
|
17
18
|
|
18
19
|
def tenant_adapter
|
data/lib/gdpr_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gdpr_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|