def update(self): """ Update all modified mutable objects in the cache This method uses MultiCall to perform the update which can significantly speed up things when compared to updating each individual object separately. Note: The update is done in batches. The maximum number of objects updated at once is controlled by the global variable MULTICALL_MAX, by default set to 10 object per session.""" for klass in self._mutable + self._containers: modified = [mutable for mutable in klass._cache.itervalues() if mutable._modified] if not modified: continue log.info("Found {0} in the {1} cache, updating...".format( listed(modified, "modified object"), klass.__name__)) for slice in sliced(modified, config.MULTICALL_MAX): multicall_start() for mutable in slice: mutable.update() multicall_end()
def update(self): """ Update all modified mutable objects in the cache This method uses MultiCall to perform the update which can significantly speed up things when compared to updating each individual object separately. Note: The update is done in batches. The maximum number of objects updated at once is controlled by the global variable MULTICALL_MAX, by default set to 10 object per session.""" for klass in self._mutable + self._containers: modified = [mutable for mutable in klass._cache.values() if mutable._modified] if not modified: continue log.info("Found {0} in the {1} cache, updating...".format( listed(modified, "modified object"), klass.__name__)) for slice in sliced(modified, config.MULTICALL_MAX): multicall_start() for mutable in slice: mutable.update() multicall_end()
def update(self): """ Update modified case runs in multicall batches """ # Check for modified case runs modified = [caserun for caserun in self if caserun._modified] if not modified: return log.info("Updating {0}'s case runs".format(self._identifier)) # Update modified caseruns in slices for slice in sliced(modified, config.MULTICALL_MAX): multicall = xmlrpclib.MultiCall(self._server) for caserun in slice: caserun._update(multicall) caserun._modified = False multicall()