public static function get_async_backups($renderer, $instanceid) {
        global $DB;

        $tabledata = array();

        // Get relevant backup ids based on context instance id.
        $select = 'itemid = ? AND execution = ? AND status < ? AND status > ?';
        $params = array($instanceid, backup::EXECUTION_DELAYED, backup::STATUS_FINISHED_ERR, backup::STATUS_NEED_PRECHECK);
        $backups = $DB->get_records_select('backup_controllers', $select, $params, 'timecreated DESC', 'id, backupid, timecreated');

        foreach ($backups as $backup) {
            $bc = \backup_controller::load_controller($backup->backupid);  // Get the backup controller.
            $filename = $bc->get_plan()->get_setting('filename')->get_value();
            $timecreated = $backup->timecreated;
            $status = $renderer->get_status_display($bc->get_status(), $bc->get_backupid());

            $tablerow = array($filename, userdate($timecreated), '-', '-', '-', $status);
            $tabledata[] = $tablerow;
        }

        return $tabledata;
    }