feat(db): remove token computations on import
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { RowDataPacket } from "mysql2/promise";
|
import { RowDataPacket } from "mysql2/promise";
|
||||||
import { Pool, PoolClient } from "pg";
|
import { Pool, PoolClient } from "pg";
|
||||||
|
|
||||||
import { computeReadingTime, computeTokenStatistics } from "@/utils/computed";
|
import { computeReadingTime } from "@/utils/computed";
|
||||||
|
|
||||||
type SourceOptions = {
|
type SourceOptions = {
|
||||||
host: string;
|
host: string;
|
||||||
@@ -293,13 +293,14 @@ export class Engine {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t === "article") {
|
// TODO: this is to heavy for the import process need to find a way to compute on creation or later
|
||||||
clone.token_statistics = computeTokenStatistics({
|
// if (t === "article") {
|
||||||
body: String(clone.body ?? ""),
|
// clone.token_statistics = computeTokenStatistics({
|
||||||
categories: Array.isArray(clone.categories) ? clone.categories : [],
|
// body: String(clone.body ?? ""),
|
||||||
title: String(clone.title ?? ""),
|
// categories: Array.isArray(clone.categories) ? clone.categories : [],
|
||||||
});
|
// title: String(clone.title ?? ""),
|
||||||
}
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user