Skip to content

Commit 44da781

Browse files
committed
Deprecate AllToSolr exporter
`AllToSolr` is not something that we use in production and it is no longer something that we would ever use in production; scheduling and coordinating when to load various record types is more nuanced than a simple "load everything at once" approach can accomplish. It is sufficiently different than other exporters that it is no longer worth the upkeep, so I am deprecating it. I'll plan to remove it entirely sometime in the near future.
1 parent 87333ed commit 44da781

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

django/sierra/export/batch_exporters.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,26 @@ def final_callback(self, vals=None, status='success'):
5757

5858
class AllToSolr(exporter.Exporter):
5959
"""
60-
Uses RecordMetadata to load ALL major III record types into Solr.
61-
Set up the EXPORTER_ALL_TYPE_REGISTRY setting in your Django
62-
settings to register what export jobs correspond with which record
63-
types. Only registered record types will be loaded.
60+
This exporter is now deprecated, please do not use.
61+
62+
If you need an exporter that runs multiple children exporters for
63+
a single batch of records, create a class that does so explicitly.
64+
From now on, `AllToSolr` will not be kept up-to-date with changes
65+
to exporters and related code.
66+
67+
`AllToSolr` will be removed in a future update.
6468
"""
6569
record_filter = []
6670
select_related = [
6771
'record_type'
6872
]
6973
model_name = 'RecordMetadata'
7074

75+
def _warn(self):
76+
msg = ('The `AllToSolr` exporter is deprecated and will be removed '
77+
'in a future update.')
78+
self.log('Warning', msg)
79+
7180
def __init__(self, *args, **kwargs):
7281
"""
7382
We want prefetch_related, record_filter, and deletion_filter
@@ -81,6 +90,7 @@ def __init__(self, *args, **kwargs):
8190
e.g. record_metadata.
8291
"""
8392
super(AllToSolr, self).__init__(*args, **kwargs)
93+
self._warn()
8494
def model_set(p_class, fieldname='', add_set=True):
8595
if fieldname == 'record_metadata':
8696
ret_val = None

0 commit comments

Comments
 (0)