Skip to content

Conversation

@mat-fs
Copy link
Contributor

@mat-fs mat-fs commented Sep 13, 2022

@mat-fs mat-fs force-pushed the compliance/sancation_list_update_centralization branch from d28123d to 3db7903 Compare September 14, 2022 03:23
@@ -0,0 +1,230 @@
package Data::Validate::Sanctions::Redis;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest naming it Data::Validate::Sanctions::Storage instead of Data::Validate::Sanctions::Redis. Redis is just a system that we are using, we may change this in future

Copy link
Contributor Author

@mat-fs mat-fs Oct 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module is exclusively created for redis storage. It relies on hmget and hmset calls and cannot be written without references to Redis. A better alternative IMHO is to use the parent class Data::Validate::Sactions as a Factory that can create an object of this subclass with a code like this:

my $validator = Data::Validate:::Sanctions->new(storage => 'redis`, connection => $redis);

- run:
name: Install Redis server
command: |
apt-get install -y redis && apt-get install -y redis-server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you need install only redis-server
and if you want to install both , you can combine them:

Suggested change
apt-get install -y redis && apt-get install -y redis-server
apt-get install -y redis-server redis

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Changes Outdated
Revision history for Data-Validate-Sanctions

{{$NEXT}}
0.14 2022-09-13 13:55:00 CST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can & should be removed. dzil release will add it automatically

}

sub get_sanction_file {
$sanction_file //= _default_sanction_file();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be better to use state here ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in some cases, the state declaration does not apply because we are using the internal scope of the variable in the set_sanction_file and the get_sanction_file subroutines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants