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

Fix errant changelog entries when executing a script without committing

This commit is contained in:
Jeremy Stretch
2019-08-26 11:59:38 -04:00
parent 6a8f256a56
commit 9a9660a765
3 changed files with 40 additions and 1 deletions

View File

@ -1,7 +1,12 @@
from cacheops.signals import cache_invalidated, cache_read
from django.dispatch import Signal
from prometheus_client import Counter
#
# Caching
#
cacheops_cache_hit = Counter('cacheops_cache_hit', 'Number of cache hits')
cacheops_cache_miss = Counter('cacheops_cache_miss', 'Number of cache misses')
cacheops_cache_invalidated = Counter('cacheops_cache_invalidated', 'Number of cache invalidations')
@ -20,3 +25,10 @@ def cache_invalidated_collector(sender, obj_dict, **kwargs):
cache_read.connect(cache_read_collector)
cache_invalidated.connect(cache_invalidated_collector)
#
# Change logging
#
purge_changelog = Signal()