Skip to content

Commit b98f8d3

Browse files
committed
Make shelflist exporters use batch mode w/Redis
When running e.g. ItemsToSolr exports that generate shelflists and store them in Redis, some of those shelflists can get quite large. This change simply adds batch options to the code that saves the shelflists in Redis, taking advantage of the changes to 'utils.redisobjs' -- so we get the performance improvements from the optimizations without potentially committing GIANT shelflists to Redis all at once and blocking for seconds at a time while a transaction runs.
1 parent cbfd76d commit b98f8d3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

django/sierra/shelflist/exporters.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,8 @@ def final_callback(self, vals=None, status='success'):
5858
self.log('Info', msg)
5959
for i, lcode in enumerate(lcodes):
6060
manifest = self.indexes['Items'].get_location_manifest(lcode)
61-
r = redisobjs.RedisObject(self.redis_shelflist_prefix, lcode)
61+
r = redisobjs.RedisObject(
62+
self.redis_shelflist_prefix, lcode, batch_size=50000,
63+
transaction_size=5
64+
)
6265
r.set(manifest)

0 commit comments

Comments
 (0)