atlas-mcp-server
Version:
ATLAS (Adaptive Task & Logic Automation System): An MCP server enabling LLM agents to manage projects, tasks, and knowledge via a Neo4j-backed, three-tier architecture. Facilitates complex workflow automation and project management through LLM Agents.
52 lines (51 loc) • 2.1 kB
JavaScript
import { exportDatabase } from "../../index.js"; // Adjusted path
import { closeNeo4jConnection } from "../../index.js"; // Adjusted path
import { logger, requestContextService } from "../../../../utils/index.js"; // Adjusted path
import { config } from "../../../../config/index.js"; // Adjusted path
/**
* Manual backup script entry point.
* This script is intended to be run from the project root.
*/
const runManualBackup = async () => {
// Initialize logger for standalone script execution
await logger.initialize(config.logLevel);
logger.info("Starting manual database backup...");
try {
const backupPath = await exportDatabase();
logger.info(`Manual backup completed successfully. Backup created at: ${backupPath}`);
}
catch (error) {
const reqContext = requestContextService.createRequestContext({
operation: "runManualBackup.catch",
});
// Ensure logger is initialized before trying to use it in catch, though it should be by now.
if (!logger["initialized"]) {
// Accessing private member for a check, not ideal but pragmatic for script
console.error("Logger not initialized during catch block. Original error:", error);
}
else {
logger.error("Manual database backup failed:", error, reqContext);
}
process.exitCode = 1; // Indicate failure
}
finally {
// Ensure the Neo4j connection is closed after the script runs
// Also ensure logger is available for these final messages
if (!logger["initialized"]) {
console.info("Closing Neo4j connection (logger was not initialized)...");
}
else {
logger.info("Closing Neo4j connection...");
}
await closeNeo4jConnection();
if (!logger["initialized"]) {
console.info("Neo4j connection closed (logger was not initialized).");
}
else {
logger.info("Neo4j connection closed.");
}
}
};
// Execute the backup process
runManualBackup();