Created
August 8, 2012 05:49
-
-
Save davidbanham/3292528 to your computer and use it in GitHub Desktop.
Cloudfiles marker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetchList = (containerName, marker, files, soFar) -> | |
if typeof soFar == 'undefined' | |
soFar = [] | |
client.getFiles containerName,marker, (err, serverFiles) -> | |
return console.log "ERROR", err if err | |
# Default max return for the rackspace API is 10000. | |
if serverFiles.length == 10000 | |
marker = serverFiles[serverFiles.length - 1].name | |
soFar = soFar.concat(serverFiles) | |
fetchList containerName, marker, files, soFar | |
else | |
serverFiles = serverFiles.concat(soFar) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment