| 96 | class PendingUpload(object): |
| 97 | # keep a track of objects that we have created but haven't distributed yet |
| 98 | def __init__(self): |
| 99 | super(self.__class__, self).__init__() |
| 100 | self.lock = RLock() |
| 101 | self.hashes = {} |
| 102 | # end by this time in any case |
| 103 | self.deadline = 0 |
| 104 | self.maxLen = 0 |
| 105 | # during shutdown, wait up to 20 seconds to finish uploading |
| 106 | self.shutdownWait = 20 |
| 107 | # forget tracking objects after 60 seconds |
| 108 | self.objectWait = 60 |
| 109 | # wait 10 seconds between clears |
| 110 | self.clearDelay = 10 |
| 111 | self.lastCleared = time.time() |
| 112 | |
| 113 | def add(self, objectHash = None): |
| 114 | with self.lock: |