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:
parent
d3f9b24cd8
commit
aa1e50858d
@ -9792,12 +9792,23 @@ sub SSCam_cache ($$;$$) {
|
|||||||
|
|
||||||
if($type eq "file") {
|
if($type eq "file") {
|
||||||
# This is a filecache using Cache::Cache.
|
# This is a filecache using Cache::Cache.
|
||||||
# https://metacpan.org/pod/Cache::Cache
|
# https://metacpan.org/pod/Cache::Cache
|
||||||
if(!(-R $path) || !(-W $path)) {
|
my $pr = (split('/',reverse($path),2))[1];
|
||||||
Log3($name, 1, "$name - ERROR - cannot create \"$type\" Cache: ".$!);
|
$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};
|
delete $hash->{HELPER}{CACHEKEY};
|
||||||
return 0;
|
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',
|
$cache = CHI->new( driver => 'CacheCache',
|
||||||
on_set_error => 'warn',
|
on_set_error => 'warn',
|
||||||
on_get_error => 'warn',
|
on_get_error => 'warn',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user