note import debug logs
This commit is contained in:
parent
50aa4667bb
commit
220b022461
@ -15,7 +15,7 @@ export async function importPosts(
|
|||||||
job: Bull.Job<DbUserImportJobData>,
|
job: Bull.Job<DbUserImportJobData>,
|
||||||
done: any,
|
done: any,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
logger.info(`Importing following of ${job.data.user.id} ...`);
|
logger.info(`Importing posts of ${job.data.user.id} ...`);
|
||||||
|
|
||||||
const user = await Users.findOneBy({ id: job.data.user.id });
|
const user = await Users.findOneBy({ id: job.data.user.id });
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
@ -39,12 +39,17 @@ export async function importPosts(
|
|||||||
for (const post of JSON.parse(csv)) {
|
for (const post of JSON.parse(csv)) {
|
||||||
try {
|
try {
|
||||||
if (post.replyId != null) {
|
if (post.replyId != null) {
|
||||||
|
logger.info(`Is reply, skip [${linenum}] ...`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (post.renoteId != null) {
|
if (post.renoteId != null) {
|
||||||
|
logger.info(`Is boost, skip [${linenum}] ...`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (post.visibility !== "public") {
|
||||||
|
logger.info(`Is non-public, skip [${linenum}] ...`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (post.visibility !== "public") continue;
|
|
||||||
const { text, cw, localOnly, createdAt } = Post.parse(post);
|
const { text, cw, localOnly, createdAt } = Post.parse(post);
|
||||||
|
|
||||||
logger.info(`Posting[${linenum}] ...`);
|
logger.info(`Posting[${linenum}] ...`);
|
||||||
|
Loading…
Reference in New Issue
Block a user