aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/storage/cloudfiles.py
diff options
context:
space:
mode:
authorBoris Bobrov <breton@cynicmansion.ru>2015-03-02 16:44:13 +0300
committerBoris Bobrov <breton@cynicmansion.ru>2015-03-02 16:44:13 +0300
commit2b4c339de6a5762c59054182034793e3b6002ee4 (patch)
treeb6bac49f255bd3aa13be17b831628dd5d390abd9 /mediagoblin/storage/cloudfiles.py
parent33055472f9fd0df5944fff232f0458dad9977e08 (diff)
downloadmediagoblin-2b4c339de6a5762c59054182034793e3b6002ee4.tar.lz
mediagoblin-2b4c339de6a5762c59054182034793e3b6002ee4.tar.xz
mediagoblin-2b4c339de6a5762c59054182034793e3b6002ee4.zip
Fix bug 647
Reading a file into memory resulted in depletion of memory. Now files are read and written lazily, by chunks.
Diffstat (limited to 'mediagoblin/storage/cloudfiles.py')
-rw-r--r--mediagoblin/storage/cloudfiles.py21
1 files changed, 0 insertions, 21 deletions
diff --git a/mediagoblin/storage/cloudfiles.py b/mediagoblin/storage/cloudfiles.py
index 532e5bac..61665ea0 100644
--- a/mediagoblin/storage/cloudfiles.py
+++ b/mediagoblin/storage/cloudfiles.py
@@ -193,27 +193,6 @@ class CloudFilesStorageObjectWrapper():
return self.storage_object.read(*args, **kwargs)
def write(self, data, *args, **kwargs):
- """
- write data to the cloudfiles storage object
-
- The original motivation for this wrapper is to ensure
- that buffered writing to a cloudfiles storage object does not overwrite
- any preexisting data.
-
- Currently this method does not support any write modes except "append".
- However if we should need it it would be easy implement.
- """
- _log.warn(
- '{0}.write() has bad performance! Use .send instead for now'\
- .format(self.__class__.__name__))
-
- if self.storage_object.size and type(data) == str:
- _log.debug('{0} is > 0 in size, appending data'.format(
- self.storage_object.name))
- data = self.read() + data
-
- _log.debug('Writing {0}'.format(
- self.storage_object.name))
self.storage_object.write(data, *args, **kwargs)
def send(self, *args, **kw):