def _transaction(self, data):
        if not self.transaction_log:
            raise TransactionLogError("No transaction log")
        
        try:
            self.transaction_lock.acquire()
            self.transaction_log.write(data)
            self.transaction_log.flush()
            self.log_size += len(data)
            if self.log_size > SOFT_LOG_MAX_SIZE and self.qsize() == 0:
                self._rotate_log()
        finally:
            self.transaction_lock.release()
dataset/ETHPy150Open cyberdelia/peafowl/peafowl/queue.py/PersistentQueue._transaction/original