Update the cache key

This commit is contained in:
FusionPBX
2025-10-16 08:15:16 -06:00
committed by GitHub
parent 1a221e0310
commit 608480b8af
5 changed files with 10 additions and 18 deletions

View File

@@ -163,7 +163,7 @@
$cache = new cache;
if (!empty($extension)) {
$cache->delete(gethostname().":directory:".$extension."@".$this->domain_name);
$cache->delete("directory:".$extension."@".$domain_name);
$cache->delete(gethostname().":directory:".$extension."@".$domain_name);
}
if (!empty($number_alias)) {
$cache->delete(gethostname().":directory:".$number_alias."@".$this->domain_name);

View File

@@ -460,10 +460,8 @@
save_gateway_xml();
//clear the cache
$esl = event_socket::create();
$hostname = trim(event_socket::api('hostname'));
$cache = new cache;
$cache->delete("configuration:sofia.conf:".$hostname);
$cache->delete(gethostname().":configuration:sofia.conf");
//create the event socket connection
$esl = event_socket::create();
@@ -583,10 +581,8 @@
save_gateway_xml();
//clear the cache
$esl = event_socket::create();
$hostname = trim(event_socket::api('hostname'));
$cache = new cache;
$cache->delete("configuration:sofia.conf:".$hostname);
$cache->delete(gethostname().":configuration:sofia.conf");
//set message
message::add($text['message-copy']);

View File

@@ -182,9 +182,7 @@
}
}
if ($empty_hostname) {
$hostnames[] = gethostname();
$hostnames[] = gethostname();
}
//clear the cache
@@ -266,7 +264,7 @@
//clear the cache
if (!empty($sip_profile_hostname)) {
$cache = new cache;
$cache->delete("configuration:sofia.conf:".$sip_profile_hostname);
$cache->delete($sip_profile_hostname.":"configuration:sofia.conf");
}
}
@@ -331,7 +329,7 @@
//get system hostname if necessary
if (empty($sip_profile_hostname)) {
$sip_profile_hostname = gethostname();
$sip_profile_hostname = gethostname();
}
//clear the cache
@@ -424,7 +422,7 @@
$hostnames = array_unique($hostnames);
$cache = new cache;
foreach ($hostnames as $hostname) {
$cache->delete("configuration:sofia.conf:".$hostname);
$cache->delete($hostname.":configuration:sofia.conf");
}
}

View File

@@ -241,7 +241,7 @@
//get the hostname
if (empty($sip_profile_hostname) {
$sip_profile_hostname = gethostname();
$sip_profile_hostname = gethostname();
}
//clear the cache

View File

@@ -67,10 +67,8 @@ function event_socket_request_cmd($cmd) {
function remove_config_from_cache($name) {
$cache = new cache;
$cache->delete($name);
$hostname = trim(event_socket_request_cmd('api switchname'));
if ($hostname) {
$cache->delete($name . ':' . $hostname);
}
$cache->delete(gethostname() . ':' . $name);
$cache->delete($name . ':' . gethostname());
}
function ListFiles($dir) {