How to immediately retrieve data after being bulk inserted into MySQL with NodeJS?

I have the following code in NodeJS that does a bulk insert of data into a table and I'd like to retrieve the last record inserted right after the bulk insert:

var mysql = require('mysql');
var pool  = mysql.createPool({
    host: process.env.MYSQL_HOST,
    user: process.env.MYSQL_USER,
    password: process.env.MYSQL_PASSWORD,
    database: process.env.MYSQL_DATABASE,
});

(async () => {
  await insert();

  // this does not return the inserted values unless I wait for ~500 ms
  console.log(await getLastRecord());
})();

function insert() {
    var sql = "INSERT IGNORE INTO my_table (id, field1, field2) VALUES ?";
    var data = [ /* ... array of 1000 records */ ];

    return new Promise((resolve, reject) => {
        pool.getConnection(function(err, connection) {
            if (!err) {
                connection.query(sql, params, function (err, result) {
                    connection.release();
                    if (err != null) reject();
                    resolve();
                });
            } else {
                reject();
            }
        });
    });
}

function getLastRecord() {
    var sql = "SELECT * FROM my_table ORDER BY id DESC";

    return new Promise((resolve, reject) => {
        pool.getConnection(function(err, connection) {
            if (!err) {
                connection.query(sql, [], function (err, result) {
                    connection.release();
                    if (err != null) reject();
                    resolve(result);
                });
            } else {
                reject();
            }
        });
    });
}

However the SELECT statement does not retrieve the most recently inserted batch. The table is a MyISAM table.