|
Lines 146-154
sub _initialize_memcached {
Link Here
|
| 146 |
utf8 => 1, |
146 |
utf8 => 1, |
| 147 |
} |
147 |
} |
| 148 |
); |
148 |
); |
|
|
149 |
|
| 149 |
# Ensure we can actually talk to the memcached server |
150 |
# Ensure we can actually talk to the memcached server |
| 150 |
my $ismemcached = $memcached->set('ismemcached','1'); |
151 |
my $ismemcached = $memcached->set('ismemcached','1'); |
| 151 |
return $self unless $ismemcached; |
152 |
if (defined($ismemcached)) { #If value is defined, memcached is alive |
|
|
153 |
if ($ismemcached) { #Value is true so operation succeeded |
| 154 |
#Ok |
| 155 |
} |
| 156 |
else { #Value is False, but still defined, so the 'ismemcached'-key already exists. |
| 157 |
#Ok, while nothing happened |
| 158 |
} |
| 159 |
} |
| 160 |
else { #Value is undefined, so there was an error with the server, or the connection to it |
| 161 |
warn "Connection to the memcached servers '@servers' failed. Are the unix socket permissions set properly? Is the host reachable?"; |
| 162 |
return $self; |
| 163 |
} |
| 152 |
$self->{'memcached_cache'} = $memcached; |
164 |
$self->{'memcached_cache'} = $memcached; |
| 153 |
return $self; |
165 |
return $self; |
| 154 |
} |
166 |
} |
| 155 |
- |
|
|