mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
invalidate dxcc cache on dxcc update
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user