upd: update limit
This commit is contained in:
parent
de9ea4d9f1
commit
2d1e8ee44d
2 changed files with 6 additions and 4 deletions
|
@ -98,7 +98,9 @@ export class ImportNotesProcessorService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (job.data.type === 'Twitter' || file.name.startsWith('twitter') && file.name.endsWith('.zip')) {
|
const type = job.data.type ?? '';
|
||||||
|
|
||||||
|
if (type === 'Twitter' || file.name.startsWith('twitter') && file.name.endsWith('.zip')) {
|
||||||
const [path, cleanup] = await createTempDir();
|
const [path, cleanup] = await createTempDir();
|
||||||
|
|
||||||
this.logger.info(`Temp dir is ${path}`);
|
this.logger.info(`Temp dir is ${path}`);
|
||||||
|
@ -159,8 +161,8 @@ export class ImportNotesProcessorService {
|
||||||
try {
|
try {
|
||||||
this.logger.succ(`Unzipping to ${outputPath}`);
|
this.logger.succ(`Unzipping to ${outputPath}`);
|
||||||
ZipReader.withDestinationPath(outputPath).viaBuffer(await fs.promises.readFile(destPath));
|
ZipReader.withDestinationPath(outputPath).viaBuffer(await fs.promises.readFile(destPath));
|
||||||
const isInstagram = job.data.type === 'Instagram' || fs.existsSync(outputPath + '/instagram_live') || fs.existsSync(outputPath + '/instagram_ads_and_businesses');
|
const isInstagram = type === 'Instagram' || fs.existsSync(outputPath + '/instagram_live') || fs.existsSync(outputPath + '/instagram_ads_and_businesses');
|
||||||
const isOutbox = job.data.type === 'Mastodon' || fs.existsSync(outputPath + '/outbox.json');
|
const isOutbox = type === 'Mastodon' || fs.existsSync(outputPath + '/outbox.json');
|
||||||
if (isInstagram) {
|
if (isInstagram) {
|
||||||
const postsJson = fs.readFileSync(outputPath + '/content/posts_1.json', 'utf-8');
|
const postsJson = fs.readFileSync(outputPath + '/content/posts_1.json', 'utf-8');
|
||||||
const posts = JSON.parse(postsJson);
|
const posts = JSON.parse(postsJson);
|
||||||
|
|
|
@ -13,7 +13,7 @@ export const meta = {
|
||||||
prohibitMoved: true,
|
prohibitMoved: true,
|
||||||
limit: {
|
limit: {
|
||||||
duration: ms('1hour'),
|
duration: ms('1hour'),
|
||||||
max: 1,
|
max: 5,
|
||||||
},
|
},
|
||||||
|
|
||||||
errors: {
|
errors: {
|
||||||
|
|
Loading…
Reference in a new issue