Skip to content

Commit 3897d15

Browse files
committed
[feature] Invalidate VPN cache when organization config variables change
Implemented automatic VPN cache invalidation to ensure VPNs always use the latest configuration when organization variables are updated. - Added signal handler to detect OrganizationConfigSettings context changes - Added Celery task to invalidate VPN cache for affected organization - Added infrastructure for automatic cache invalidation This prevents VPNs from using stale configuration data and resolves connectivity issues caused by outdated cache. Fixes #1098
1 parent 7fac9a1 commit 3897d15

File tree

2 files changed

+6
-186
lines changed

2 files changed

+6
-186
lines changed

openwisp_controller/config/apps.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def enable_cache_invalidation(self):
270270
device_cache_invalidation_handler,
271271
devicegroup_change_handler,
272272
devicegroup_delete_handler,
273-
organization_config_settings_change_handler,
273+
# organization_config_settings_change_handler,
274274
vpn_server_change_handler,
275275
)
276276

@@ -337,11 +337,11 @@ def enable_cache_invalidation(self):
337337
sender=self.vpn_model,
338338
dispatch_uid="vpn.invalidate_checksum_cache",
339339
)
340-
post_save.connect(
341-
organization_config_settings_change_handler,
342-
sender=self.organization_config_settings_model,
343-
dispatch_uid="organization_config_settings.invalidate_vpn_cache",
344-
)
340+
# post_save.connect(
341+
# organization_config_settings_change_handler,
342+
# sender=self.organization_config_settings_model,
343+
# dispatch_uid="organization_config_settings.invalidate_vpn_cache",
344+
# )
345345

346346
def register_dashboard_charts(self):
347347
register_dashboard_chart(

openwisp_controller/config/tests/test_organization_vpn_cache.py

Lines changed: 0 additions & 180 deletions
This file was deleted.

0 commit comments

Comments
 (0)