<commit_before>#!/usr/bin/perl

package ResourcePool::Resource::Redis;
use strict;
use warnings;
use Redis;

our $VERSION = 1.0;
use base qw(ResourcePool::Resource);

sub new {
	my $proto = shift;
	my $class = ref($proto) || $proto;
	my $self = $class->SUPER::new();
	my %args = @_;

	$self->{'redis'} = eval {Redis->new(%args)};
	warn $@ if $@;

	bless($self, $class);
	return $self;
}

sub close {
	my ($self) = @_;
	$self->{'redis'}->quit();<commit_msg>Attampt to close failed handle in fail_close()<commit_after>#!/usr/bin/perl

package ResourcePool::Resource::Redis;
use strict;
use warnings;
use Redis;

our $VERSION = 1.0;
use base qw(ResourcePool::Resource);

sub new {
	my $proto = shift;
	my $class = ref($proto) || $proto;
	my $self = $class->SUPER::new();
	my %args = @_;

	$self->{'redis'} = eval {Redis->new(%args)};
	warn $@ if $@;

	bless($self, $class);
	return $self;
}

sub close {
	my ($self) = @_;
	$self->{'redis'}->quit();
	return;
}

sub fail_close {
	eval {shift->close()};
{'fraction_non_alphanumeric': 0.21442885771543085, 'fraction_numerical': 0.004008016032064128, 'mean_word_length': 4.489010989010989, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4103881', 'n_tokens_mistral': 410, 'n_tokens_neox': 393, 'n_words': 96}