diff options
| author | Mar0xy <marie@kaifa.ch> | 2023-11-12 15:37:36 +0100 |
|---|---|---|
| committer | Mar0xy <marie@kaifa.ch> | 2023-11-12 15:37:36 +0100 |
| commit | 2d1e8ee44d4e37b505e740c7071bee42bcc0fca2 (patch) | |
| tree | c6d1e6b5fe043e17de0bda3cb5d29843824112f4 /packages | |
| parent | fix: type (diff) | |
| download | sharkey-2d1e8ee44d4e37b505e740c7071bee42bcc0fca2.tar.gz sharkey-2d1e8ee44d4e37b505e740c7071bee42bcc0fca2.tar.bz2 sharkey-2d1e8ee44d4e37b505e740c7071bee42bcc0fca2.zip | |
upd: update limit
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/backend/src/queue/processors/ImportNotesProcessorService.ts | 8 | ||||
| -rw-r--r-- | packages/backend/src/server/api/endpoints/i/import-notes.ts | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts index b8e68ae196..e7e8cee3a7 100644 --- a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts @@ -98,7 +98,9 @@ export class ImportNotesProcessorService { 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(); this.logger.info(`Temp dir is ${path}`); @@ -159,8 +161,8 @@ export class ImportNotesProcessorService { try { this.logger.succ(`Unzipping to ${outputPath}`); 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 isOutbox = job.data.type === 'Mastodon' || fs.existsSync(outputPath + '/outbox.json'); + const isInstagram = type === 'Instagram' || fs.existsSync(outputPath + '/instagram_live') || fs.existsSync(outputPath + '/instagram_ads_and_businesses'); + const isOutbox = type === 'Mastodon' || fs.existsSync(outputPath + '/outbox.json'); if (isInstagram) { const postsJson = fs.readFileSync(outputPath + '/content/posts_1.json', 'utf-8'); const posts = JSON.parse(postsJson); diff --git a/packages/backend/src/server/api/endpoints/i/import-notes.ts b/packages/backend/src/server/api/endpoints/i/import-notes.ts index 1e572d3d7e..87b739f369 100644 --- a/packages/backend/src/server/api/endpoints/i/import-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/import-notes.ts @@ -13,7 +13,7 @@ export const meta = { prohibitMoved: true, limit: { duration: ms('1hour'), - max: 1, + max: 5, }, errors: { |