Skip to content

Commit

Permalink
Preserve more context from end of chunk for syncing long datastream info
Browse files Browse the repository at this point in the history
  • Loading branch information
rlskoeser committed Mar 4, 2016
1 parent 2042420 commit cb55302
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions eulfedora/syncutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def get_next_chunk(self):
self._iter_content = self.get_export().iter_content(self.read_block_size)

if self._current_chunk is not None:
self.end_of_last_chunk = self._current_chunk[-200:]
self.end_of_last_chunk = self._current_chunk[-400:]

self._current_chunk = self._chunk_leftover + six.next(self._iter_content)

Expand Down Expand Up @@ -305,7 +305,8 @@ def object_data(self):
else:
# error if datastream info is not found, because either
# size or version date is required to handle content
raise Exception('Failed to find datastream information from \n%s' % previous_section)
raise Exception('Failed to find datastream information for %s from \n%s' \
% (self.obj.pid, previous_section))

if self.xml_only and not dsinfo['mimetype'] == 'text/xml': # possibly others?
try:
Expand Down

0 comments on commit cb55302

Please sign in to comment.