mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-25 15:46:06 +09:00
update post job
This commit is contained in:
parent
d0f2cbd664
commit
f43b5a2537
@ -31,12 +31,12 @@ export async function importPosts(
|
||||
return;
|
||||
}
|
||||
|
||||
const csv = await downloadTextFile(file.url);
|
||||
const json = await downloadTextFile(file.url);
|
||||
|
||||
let linenum = 0;
|
||||
|
||||
if (file.type.endsWith("json")) {
|
||||
for (const post of JSON.parse(csv)) {
|
||||
try {
|
||||
for (const post of JSON.parse(json)) {
|
||||
try {
|
||||
if (post.replyId != null) {
|
||||
logger.info(`Is reply, skip [${linenum}] ...`);
|
||||
@ -74,6 +74,9 @@ export async function importPosts(
|
||||
logger.warn(`Error in line:${linenum} ${e}`);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// handle error
|
||||
logger.warn(`Error reading: ${e}`);
|
||||
}
|
||||
|
||||
logger.succ("Imported");
|
||||
|
Loading…
Reference in New Issue
Block a user