42 lines
2.0 KiB
JavaScript
42 lines
2.0 KiB
JavaScript
"use strict";
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.default = dockerTestMaxscaleConnection;
|
|
let checkDbRetries = 0;
|
|
const MAX_CHECK_DB_RETRIES = 10;
|
|
const DEFAULT_SLEEP_TIME = 3000;
|
|
function dockerTestMaxscaleConnection(params) {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const maxRetries = (params === null || params === void 0 ? void 0 : params.maxRetries) || MAX_CHECK_DB_RETRIES;
|
|
const sleepTime = (params === null || params === void 0 ? void 0 : params.sleepTime) || DEFAULT_SLEEP_TIME;
|
|
// while (true) {
|
|
// if (checkDbRetries > maxRetries) {
|
|
// debugLog({
|
|
// log: `Max Retries for checking Database. Exiting ...`,
|
|
// addTime: true,
|
|
// label: "MaxRetries",
|
|
// });
|
|
// process.exit(1);
|
|
// }
|
|
// const checkDb = mariaDBlocalQuery(`SHOW DATABASES`);
|
|
// const isDbReady =
|
|
// typeof checkDb == "string" &&
|
|
// Boolean(checkDb.match(/\ninformation_schema\n/));
|
|
// if (isDbReady) {
|
|
// break;
|
|
// } else {
|
|
// checkDbRetries++;
|
|
// await Bun.sleep(sleepTime);
|
|
// }
|
|
// }
|
|
});
|
|
}
|