summaryrefslogtreecommitdiff
path: root/packages/backend/src/queue/processors
diff options
context:
space:
mode:
authorMar0xy <marie@kaifa.ch>2023-11-12 18:01:39 +0100
committerMar0xy <marie@kaifa.ch>2023-11-12 18:01:39 +0100
commit486a2ad8395d0b5c7aee77f75a3d9cc3392db4a0 (patch)
tree6725faf4dc05cf16bbaffb318b6cc4ea1c7638bc /packages/backend/src/queue/processors
parentfix: cleanup not available on development env (diff)
downloadsharkey-486a2ad8395d0b5c7aee77f75a3d9cc3392db4a0.tar.gz
sharkey-486a2ad8395d0b5c7aee77f75a3d9cc3392db4a0.tar.bz2
sharkey-486a2ad8395d0b5c7aee77f75a3d9cc3392db4a0.zip
upd: remove unused function, fix logger message
Diffstat (limited to 'packages/backend/src/queue/processors')
-rw-r--r--packages/backend/src/queue/processors/ImportNotesProcessorService.ts12
1 files changed, 2 insertions, 10 deletions
diff --git a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts
index b209d7239c..7bf445bc9d 100644
--- a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts
+++ b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts
@@ -42,14 +42,6 @@ export class ImportNotesProcessorService {
) {
this.logger = this.queueLoggerService.logger.createSubLogger('import-notes');
}
- @bindThis
- private async _keepTweet(tweet: any) {
- if (!tweet.created_at.endsWith(new Date().getFullYear())) {
- return false;
- }
-
- return !tweet.full_text.startsWith('@');
- }
@bindThis
private async uploadFiles(dir: any, user: any) {
@@ -84,7 +76,7 @@ export class ImportNotesProcessorService {
@bindThis
public async process(job: Bull.Job<DbNoteImportJobData>): Promise<void> {
- this.logger.info(`Importing following of ${job.data.user.id} ...`);
+ this.logger.info(`Starting note import of ${job.data.user.id} ...`);
const user = await this.usersRepository.findOneBy({ id: job.data.user.id });
if (user == null) {
@@ -135,7 +127,7 @@ export class ImportNotesProcessorService {
script.runInContext(context);
const tweets = Object.keys(fakeWindow.window.YTD.tweets.part0).reduce((m, key, i, obj) => {
return m.concat(fakeWindow.window.YTD.tweets.part0[key].tweet);
- }, []).filter(this._keepTweet);
+ }, []);
this.queueService.createImportTweetsToDbJob(job.data.user, tweets);
} finally {
cleanup();