invalidate dxcc cache on dxcc update

This commit is contained in:
HB9HIL
2026-02-17 14:13:49 +01:00
parent de02672ab8
commit ec1dd936e3

View File

@@ -272,6 +272,8 @@ class Update extends CI_Controller {
$this->db->query($sql);
$this->db->trans_complete();
$this->_invalidate_dxcc_cache();
$this->update_status(__("DONE"));
echo 'success';
@@ -292,6 +294,26 @@ class Update extends CI_Controller {
}
private function _invalidate_dxcc_cache() {
$this->load->is_loaded('cache') ?: $this->load->driver('cache', [
'adapter' => $this->config->item('cache_adapter') ?? 'file',
'backup' => $this->config->item('cache_backup') ?? 'file',
'key_prefix' => $this->config->item('cache_key_prefix') ?? ''
]);
$possible_cachekeys = [
'dxcc_exceptions',
'dxcc_prefixes',
];
foreach ($possible_cachekeys as $cache_key) {
if ($this->cache->get($cache_key) !== false) {
$this->cache->delete($cache_key);
log_message('info', "Deleted cache for key: " . $cache_key);
}
}
}
public function update_status($done=""){
if(!$this->load->is_loaded('Paths')) {