def autoRefresh(jar): # Must be called before there are any changes made # by the connection to the database! auto_refresh_ids = checkAutoRefresh(jar) if auto_refresh_ids: finishAutoRefresh(jar, auto_refresh_ids) from ZODB import Connection Connection.updateCodeTimestamp() get_transaction().commit() jar._resetCache() get_transaction().begin()
def manage_performRefresh(self, REQUEST=None): ''' Attempts to perform a refresh operation. ''' if self._readRefreshTxt() is None: raise Unauthorized, 'refresh.txt not found' message = None if RefreshFuncs.performFullRefresh(self._p_jar, self.id): from ZODB import Connection Connection.updateCodeTimestamp() # Clears cache in next connection. message = 'Product refreshed.' else: message = 'An exception occurred.' if REQUEST is not None: return self.manage_refresh(REQUEST, manage_tabs_message=message)