Coverage for netbox/constants.py: 100%

9 statements  

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

1CORE_APPS = ( 

2 'account', 

3 'circuits', 

4 'core', 

5 'dcim', 

6 'extras', 

7 'ipam', 

8 'tenancy', 

9 'users', 

10 'utilities', 

11 'virtualization', 

12 'vpn', 

13 'wireless', 

14) 

15 

16# RQ queue names 

17RQ_QUEUE_DEFAULT = 'default' 

18RQ_QUEUE_HIGH = 'high' 

19RQ_QUEUE_LOW = 'low' 

20 

21# Keys for PostgreSQL advisory locks. These are arbitrary bigints used by the advisory_lock 

22# context manager. When a lock is acquired, one of these keys will be used to identify said lock. 

23# When adding a new key, pick something arbitrary and unique so that it is easily searchable in 

24# query logs. 

25ADVISORY_LOCK_KEYS = { 

26 # Available object locks 

27 'available-prefixes': 100100, 

28 'available-ips': 100200, 

29 'available-vlans': 100300, 

30 'available-asns': 100400, 

31 

32 # Jobs 

33 'job-schedules': 110100, 

34 

35 # Custom field data 

36 'custom-field-data': 115100, 

37} 

38 

39# General-purpose tokens 

40CENSOR_TOKEN = '********' 

41CENSOR_TOKEN_CHANGED = '***CHANGED***' 

42 

43# Placeholder text for empty tables 

44EMPTY_TABLE_TEXT = 'No results found' 

45 

46# Batch size for deleting a JobsMixin object's associated jobs during cascade deletion. Job 

47# cannot be fast-deleted (a global pre_delete receiver forces per-instance signals), so deleting 

48# in chunks bounds the work per delete cycle rather than building one huge collection and running 

49# one long DELETE. 1000 matches EXPORT_CHUNK_SIZE and, in benchmarking a 200k-job deletion, was 

50# the fastest of 100/1000/5000 while keeping peak memory flat. See #22812. 

51JOB_DELETE_BATCH_SIZE = 1000