def add_cache(self, namespace, key, query_hash, length, cache):
        start = 0
        bulk_insert = self.bulk_insert
        cache_len = len(cache)
        row = '(%s,%s,%s,%s,%s,%s)'
        query = 'INSERT IGNORE INTO gauged_cache ' \
            '(namespace, `key`, hash, length, start, value) VALUES '
        execute = self.cursor.execute
        while start < cache_len:
            rows = cache[start:start+bulk_insert]
            params = []
            for timestamp, value in rows:
                params.extend((namespace, key, query_hash, length,
                               timestamp, value))
            insert = (row + ',') * (len(rows) - 1) + row
            execute(query + insert, params)
            start += bulk_insert
        self.db.commit()
Method called whenever a message is seen on the bus.
dataset/ETHPy150Open chriso/gauged/gauged/drivers/mysql.py/MySQLDriver.add_cache--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/scsgate.py/SCSGate.handle_message