1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Skip clearing cache when handling new objects

This commit is contained in:
jeremystretch
2023-02-17 20:30:35 -05:00
committed by Jeremy Stretch
parent cd09501d4d
commit 0855ff8b42

View File

@ -54,11 +54,11 @@ class SearchBackend:
"""
raise NotImplementedError
def caching_handler(self, sender, instance, **kwargs):
def caching_handler(self, sender, instance, created, **kwargs):
"""
Receiver for the post_save signal, responsible for caching object creation/changes.
"""
self.cache(instance)
self.cache(instance, remove_existing=not created)
def removal_handler(self, sender, instance, **kwargs):
"""