Revision 438efab2

b/kamaki/clients/pithos/__init__.py
731 731
            self._cb_next(len(blockids) - len(unsaved))
732 732
            if unsaved:
733 733
                key = unsaved[0]
734
                if key:
735
                    self._watch_thread_limit(flying.values())
736
                    self._thread2file(
737
                        flying, blockid_dict, local_file, offset,
738
                        **restargs)
739
                    end = total_size - 1 if (
740
                        key + blocksize > total_size) else key + blocksize - 1
741
                    data_range = _range_up(key, end, total_size, filerange)
742
                    if not data_range:
743
                        self._cb_next()
744
                        continue
745
                    restargs[
746
                        'async_headers'] = {'Range': 'bytes=%s' % data_range}
747
                    flying[key] = self._get_block_async(obj, **restargs)
748
                    blockid_dict[key] = unsaved
734
                self._watch_thread_limit(flying.values())
735
                self._thread2file(
736
                    flying, blockid_dict, local_file, offset,
737
                    **restargs)
738
                end = total_size - 1 if (
739
                    key + blocksize > total_size) else key + blocksize - 1
740
                if end < key:
741
                    self._cb_next()
742
                    continue
743
                data_range = _range_up(key, end, total_size, filerange)
744
                if not data_range:
745
                    self._cb_next()
746
                    continue
747
                restargs[
748
                    'async_headers'] = {'Range': 'bytes=%s' % data_range}
749
                flying[key] = self._get_block_async(obj, **restargs)
750
                blockid_dict[key] = unsaved
749 751

  
750 752
        for thread in flying.values():
751 753
            thread.join()

Also available in: Unified diff