diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-11-12 15:08:36 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-11-12 15:08:36 +0900 |
| commit | b404ce463fe6386f35f0a66ede6871082f1540bf (patch) | |
| tree | 84b386d849a36156c6e7a860f0d2e3f1e7c8b622 /packages/backend/src/queue/processors/db | |
| parent | fix bug (diff) | |
| download | sharkey-b404ce463fe6386f35f0a66ede6871082f1540bf.tar.gz sharkey-b404ce463fe6386f35f0a66ede6871082f1540bf.tar.bz2 sharkey-b404ce463fe6386f35f0a66ede6871082f1540bf.zip | |
refactor
Diffstat (limited to 'packages/backend/src/queue/processors/db')
| -rw-r--r-- | packages/backend/src/queue/processors/db/export-notes.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/backend/src/queue/processors/db/export-notes.ts b/packages/backend/src/queue/processors/db/export-notes.ts index 49850aa706..bd178556df 100644 --- a/packages/backend/src/queue/processors/db/export-notes.ts +++ b/packages/backend/src/queue/processors/db/export-notes.ts @@ -46,18 +46,18 @@ export async function exportNotes(job: Bull.Job<DbUserJobData>, done: any): Prom }); let exportedNotesCount = 0; - let cursor: any = null; + let cursor: Note['id'] | null = null; while (true) { const notes = await Notes.find({ where: { userId: user.id, - ...(cursor ? { id: MoreThan(cursor) } : {}) + ...(cursor ? { id: MoreThan(cursor) } : {}), }, take: 100, order: { - id: 1 - } + id: 1, + }, }); if (notes.length === 0) { @@ -115,7 +115,7 @@ export async function exportNotes(job: Bull.Job<DbUserJobData>, done: any): Prom done(); } -function serialize(note: Note, poll: Poll | null = null): any { +function serialize(note: Note, poll: Poll | null = null): Record<string, unknown> { return { id: note.id, text: note.text, @@ -128,6 +128,6 @@ function serialize(note: Note, poll: Poll | null = null): any { viaMobile: note.viaMobile, visibility: note.visibility, visibleUserIds: note.visibleUserIds, - localOnly: note.localOnly + localOnly: note.localOnly, }; } |