2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 23:06:37 +00:00

49_SSCam: contrib 9.0.3

git-svn-id: https://svn.fhem.de/fhem/trunk@20468 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2019-11-06 22:17:49 +00:00
parent d3f9b24cd8
commit aa1e50858d

View File

@ -9793,11 +9793,22 @@ sub SSCam_cache ($$;$$) {
if($type eq "file") {
# This is a filecache using Cache::Cache.
# https://metacpan.org/pod/Cache::Cache
if(!(-R $path) || !(-W $path)) {
Log3($name, 1, "$name - ERROR - cannot create \"$type\" Cache: ".$!);
my $pr = (split('/',reverse($path),2))[1];
$pr = reverse($pr);
if(!(-R $pr) || !(-W $pr)) { # root-erzeichnis testen
Log3($name, 1, "$name - ERROR - cannot create \"$type\" Cache in dir \"$pr\": ".$!);
delete $hash->{HELPER}{CACHEKEY};
return 0;
}
if(!(-d $path)) { # Zielverzeichnis anlegen wenn nicht vorhanden
my $success = mkdir($path,0775);
if(!$success) {
Log3($name, 1, "$name - ERROR - cannot create \"$type\" Cache path \"$path\": ".$!);
delete $hash->{HELPER}{CACHEKEY};
return 0;
}
}
$cache = CHI->new( driver => 'CacheCache',
on_set_error => 'warn',
on_get_error => 'warn',