Update
This commit is contained in:
@ -107,7 +107,7 @@ function extractDomain(url: string): string | null {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize database with proper error handling
|
// Initialize database with proper error handling
|
||||||
function initializeDatabase(): Database {
|
async function initializeDatabase(): Database {
|
||||||
// Ensure data directory exists
|
// Ensure data directory exists
|
||||||
if (!fs.existsSync(config.paths.dataDir)) {
|
if (!fs.existsSync(config.paths.dataDir)) {
|
||||||
fs.mkdirSync(config.paths.dataDir, { recursive: true });
|
fs.mkdirSync(config.paths.dataDir, { recursive: true });
|
||||||
@ -205,7 +205,7 @@ function initializeDatabase(): Database {
|
|||||||
// Perform database integrity checks and fixes
|
// Perform database integrity checks and fixes
|
||||||
performDatabaseIntegrityFixes(db);
|
performDatabaseIntegrityFixes(db);
|
||||||
|
|
||||||
migrateFeedsWithCategories(db);
|
await migrateFeedsWithCategories(db);
|
||||||
|
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
@ -1126,7 +1126,7 @@ export async function updateFeedRequestStatus(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Migration function to classify existing feeds without categories
|
// Migration function to classify existing feeds without categories
|
||||||
export function migrateFeedsWithCategories(db: Database): void {
|
export async function migrateFeedsWithCategories(db: Database): void {
|
||||||
try {
|
try {
|
||||||
console.log("🔄 Starting feed category migration...");
|
console.log("🔄 Starting feed category migration...");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user