def _sync(self):
if (self._opcount > self.checkpoint_operations or<EOL>datetime.now() > self._last_sync + self.checkpoint_timeout):<EOL><INDENT>self.log.debug("<STR_LIT>")<EOL>self.queue_metadata.sync()<EOL>self._last_sync = datetime.now()<EOL>self._opcount = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>self.log.debug("<STR_LIT>")<EOL><DEDENT>
Synchronize the cached data with the underlyind database.

Uses an internal transaction counter and compares to the checkpoint_operations
and checkpoint_timeout paramters to determine whether to persist the memory store.

In this implementation, this method wraps calls to C{shelve.Shelf#sync}.