Coverage for netbox/search/jobs.py: 89%

9 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-10 18:35 +0000

1import logging 

2 

3from netbox.jobs import JobRunner 

4from netbox.search.backends import search_backend 

5 

6# Internal search-indexing machinery; not part of the public/plugin API. 

7 

8logger = logging.getLogger(__name__) 

9 

10 

11class SearchCacheJob(JobRunner): 

12 """ 

13 Background job which applies deferred updates to the global search cache. 

14 """ 

15 class Meta: 

16 name = 'Search cache update' 

17 

18 def run(self, using=None, cache_groups=None, remove_groups=None, **kwargs): 

19 search_backend._apply_deferred_updates( 

20 using=using, 

21 cache_groups=cache_groups, 

22 remove_groups=remove_groups, 

23 log=self.logger, 

24 )